-
Notifications
You must be signed in to change notification settings - Fork 71
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
call_as_daemon method don't stop child process #93
Comments
Thank you for the report. I am not sure why you would want to use at_exit in such a scenario, but also I currently cannot follow on why the first child should not exit in this case? Do I understand correctly, that your proposed solution is to replace |
Yes.
This issue occurs with delayed_job and debug. Next, loaded debug. https://github.com/ruby/debug/blob/v1.9.2/lib/debug/local.rb#L106-L107 delayed_job tries to increase the number of workers, but the child process is not stopped, just like the repro program. |
Your environment
ruby -v
: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]Describe the bug
Calling Process.waitpid inside the at_exit method will prevent the child process from stopping.
To Reproduce
Script:
Gemfile
test_daemon.rb
Terminal:
Child process doesn't stop.
The following fork operations are no longer possible.
daemons/lib/daemons.rb
Lines 43 to 51 in a0e84bc
By the way, I encountered this problem when using delayed_job and debug.
Expected behavior
Child processes can be stopped.
Since the first child process should be stopped, I thought it would be a good idea to change the call to the exit! method.
daemons/lib/daemons/daemonize.rb
Line 67 in a0e84bc
The text was updated successfully, but these errors were encountered: