Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process.c: Add Process._fork #5017

Merged
merged 7 commits into from
Oct 25, 2021
Merged

process.c: Add Process._fork #5017

merged 7 commits into from
Oct 25, 2021

Conversation

mame
Copy link
Member

@mame mame commented Oct 25, 2021

This API is supposed for application monitoring libraries to hook fork
event.

[Feature #17795]

This API is supposed for application monitoring libraries to hook fork
event.

[Feature #17795]
@mame mame requested review from byroot and nobu October 25, 2021 04:16
internal/process.h Outdated Show resolved Hide resolved
process.c Outdated Show resolved Hide resolved
process.c Show resolved Hide resolved
process.c Outdated Show resolved Hide resolved
...or a platform that has no fork

https://github.com/mame/ruby/runs/3992670825?check_suite_focus=true
```
../src/process.c:8731:54: error: 'rb_proc__fork' undeclared (first use in this function); did you mean 'rb_proc_dup'?
 8731 |     rb_define_singleton_method(rb_mProcess, "_fork", rb_proc__fork, 0);
```
@ioquatix
Copy link
Member

Why not use something like tracepoint?

@byroot
Copy link
Member

byroot commented Oct 25, 2021

Why not use something like tracepoint?

That would be a lot of overhead for just catching forks. See https://github.com/rails/rails/blob/31ad3f152954142c68c030db596c35e31ca93a76/activesupport/lib/active_support/fork_tracker.rb for instance.

@ioquatix
Copy link
Member

Sorry for the terse reply, I didn't realise there was such discussion behind the issue already. I just spent some time to read it. I'll reply on the RBT issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants