jberger / Mojo-IOLoop-ForkCall

Deprecated! Use Mojo::IOLoop::Subprocess instead
https://mojolicious.org/perldoc/Mojo/IOLoop/Subprocess
5 stars 2 forks source link

Event "close" failed: wait returned -1 #2

Closed jhthorsen closed 10 years ago

jhthorsen commented 10 years ago

I'm using your module, and I'm getting a lot of these error messages:

(in cleanup) Mojo::IOLoop::Stream: Event "close" failed: wait returned -1: No such process 7518 at perl-5.18.1/lib/site_perl/5.18.1/Mojo/IOLoop/ForkCall.pm line 56.

Any idea why? The code I'm running is here: https://github.com/jhthorsen/snippets/blob/master/bin/billy#L77

I wonder if it's a timing issue when the system is under heavy load.

Maybe a fix could be:

$child->wait unless $child->is_complete;
jberger commented 10 years ago

This is a tough one to know how to handle. is_complete actually does a non-blocking waitpid so there are cases where that throws errors too (I have seen it). Perhaps it's best to just try to suppress the message as I don't think there is any reason to worry about it.

Thoughts?

Cool use case btw On Dec 16, 2013 2:36 PM, "Jan Henning Thorsen" notifications@github.com wrote:

I'm using your module, and I'm getting a lot of these error messages:

(in cleanup) Mojo::IOLoop::Stream: Event "close" failed: wait returned -1: No such process 7518 at perl-5.18.1/lib/site_perl/5.18.1/Mojo/IOLoop/ForkCall.pm line 56.

Any idea why? The code i'm running is here: https://github.com/jhthorsen/snippets/blob/master/bin/billy#L77

I wonder if it's a timing issue when the system is under heavy load.

Maybe a fix could be:

$child->wait unless $child->is_complete;

— Reply to this email directly or view it on GitHubhttps://github.com/jberger/Mojo-IOLoop-ForkCall/issues/2 .

jhthorsen commented 10 years ago

What I don't understand is how the PID is picked up. There's no $SIG{CHLD} handler anywhere, or...?

jberger commented 10 years ago

@jhthorsen would you please try out the code in this new branch https://github.com/jberger/Mojo-IOLoop-ForkCall/tree/nochild ?

jberger commented 10 years ago

This seems to be fixed by at least 0.06 release. I haven't checked, but I suspect the fix came at 6c8abb295b872b40f1aa7ba25bff403df1fbcd20

jhthorsen commented 10 years ago

Thanks! (Sorry for not testing, when asked to)