-
Notifications
You must be signed in to change notification settings - Fork 127
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
after_fork_parent method waits for all child processes to stop #1099
Comments
👋 I don't have good context around the forking mechanism, but as a workaround you can add |
Thank you. I added Script: Gemfile
test_daemons.rb
Terminal:
|
Thank you. I didn't check daemons yet, so it can be a bug for tracking processes. |
Your environment
ruby -v
: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]rdbg -v
: rdbg 1.9.2Describe the bug
I'm using delayed_job.
When I tried to increase the number of workers, the number of workers did not increase because the child process did not stop.
The problem was due to Process.waitpid below.
https://github.com/ruby/debug/blob/master/lib/debug/local.rb#L106-L107
To Reproduce
delayed_job uses daemons.
Script:
Gemfile
test_daemon.rb
Terminal:
Child processes do not stop and workers do not increase.
The following fork operations are no longer possible.
https://github.com/thuehlinger/daemons/blob/a0e84bcebe8b872ff59e1e0aa10e1f1718a933b1/lib/daemons.rb#L43-L51
Also, in Rails development, debug is loaded by default, When starting delayed_job, unexpected block is caused by this issue.
https://github.com/rails/rails/blob/5e0c7388a378f4beb5368217a8f57f3c1bfbfabe/railties/lib/rails/generators/rails/app/templates/Gemfile.tt#L36
Expected behavior
Child processes other than debug do not wait to stop.
The text was updated successfully, but these errors were encountered: