-
Notifications
You must be signed in to change notification settings - Fork 759
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
Worker pcntl_wait to non-blocking loop #189
base: master
Are you sure you want to change the base?
Conversation
Putting the thread to sleep with wait no longer allows signals to be captured. This allow signals like USR1 to be used again Correct Parse error in Worker Finally currect parse error
It looks like #83 could also solve this problem, but I have not personally tested that PR |
I have tested #83, heavily, but that's beside the point. My concern with this is that a It'll be tricky to figure out a better workaround... Honestly, ignoring signals during As to #83, it's only real problem is that there are too many things I fixed in a single PR. And now I'd have to rebase it to get it working again. |
Would a micro sleep like you used in #83 be an acceptable hack then? Sent from my Droid 4 |
Email replies to GitHub issues are UGLY... Yes, given that's the entire reason I put the micro sleep in there to begin with. :-) |
Sorry I wasn’t trying to imply #83 was not well tested, only that I had not confirmed if it properly responded to signals. I just pushed a commit that adds a half second delay in checking for new signals |
Are jobs that are killed with a USR1 supposed to be added to the failed job queue? |
This is a good question... |
Putting the thread to sleep with
pcntl_wait
no longer allows signals to be captured (PHP 5 >= 5.3.0). This PR putspcntl_wait
into a while loop waiting for the child to exit, and allows signals like USR1 to be used again (pcntl_signal_dispatch
being called inside the loop).My only concern would be compatibility with PHP< 5.3.0
http://www.php.net/manual/en/function.pcntl-signal.php#114575
http://www.php.net/manual/en/function.pcntl-signal-dispatch.php