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

Signal handling for sleep #44

Closed
azrle opened this issue Oct 12, 2016 · 4 comments
Closed

Signal handling for sleep #44

azrle opened this issue Oct 12, 2016 · 4 comments

Comments

@azrle
Copy link
Contributor

azrle commented Oct 12, 2016

@kazuho

We observed that KILL_OLD_DELAY may be interrupted by signal while waiting for new workers, using Perl 5.16, Linux.

sleep $kill_old_delay;

As far as I know, sleep can be interrupted and Perl will not call the system call (in our environment, implemented by nanosleep) again for rest of seconds.

As a result, in some use cases, old workers are unexpectedly killed before new workers become capable to accept requests.
For example,

  • try to reload env while waiting for new workers
  • reload codes while waiting for new workers

Is it by design?
Or is it okay to fix it by sleeping again for rest of seconds when it was interrupted?

@kazuho
Copy link
Owner

kazuho commented Oct 12, 2016

Thank you for opening the issue.

Or is it okay to fix it by sleeping again for rest of seconds when it was interrupted?

I think this is the right thing to do.

@azrle
Copy link
Contributor Author

azrle commented Oct 14, 2016

Thanks.
I would send a PR recently. :)

@azrle
Copy link
Contributor Author

azrle commented Oct 25, 2016

@kazuho I have sent a pull request #45. Please check it.

Thanks.

@azrle
Copy link
Contributor Author

azrle commented Dec 13, 2016

See it in 0.33. :)

@azrle azrle closed this as completed Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants