Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Parallel-WorkUnit CPAN distribution.

Report information
The Basics
Id: 105823
Status: resolved
Priority: 0/
Queue: Parallel-WorkUnit

People
Owner: jmaslak [...] antelope.net
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.001
Fixed in: 1.002



Subject: Dont set $SIG{CHLD}="IGNORE"
By setting $SIG{CHLD}="IGNORE" all system() calls in the same process are broken with respect to the return value: $ perl5.22.0 -e 'system("true"); warn $?' 0 at -e line 1. $ perl5.22.0 -MParallel::WorkUnit -e 'Parallel::WorkUnit->new; system("true"); warn $?' -1 at -e line 1. Actually, as wait() or waitall() has to be called anyway and these methods reap the children, I don't see that it's necessary to set $SIG{CHLD} at all. Is this just for double safety, or is there another reason?
You are right - I'll put together a fix, there are probably a couple problems with the way I did it. I added a test case and believe I have a solution. I'm also trying to fix some Windows issues, which hopefully will happen today, so I'll be combining this fix with that one.
I reworked the child handling, so that it now shouldn't do anything with any processes that aren't directly related to itself. I also added your case as a test case (which will be skipped in the event of execution on a platform without true in either /bin or /usr/bin). Running: perl -MParallel::WorkUnit -e 'Parallel::WorkUnit->new; system("true"); warn $?' Now returns: 0 at -e line 1.