After having a look at the code and testing further, I think that the problem is the local scope of the $SIG{CHILD} in ForkManager's sub wait_on. Obviously, the empty subroutine is set in order to yank the process free of the following sleep (select) statement, otherwise IGNORE/undef would do just fine. When the process leaves the sub on_wait, then $SIG{CHILD} is reset to undef (likely meaning IGNORE). However, if more signals hit the process at just the right time (when exiting the sub/resetting $SIG{CHILD}), then the error is triggered. I can reproduce it outside ForkManager, so it is nothing special in ForkManager.
This error should only occur in forkmanager if the user has not set $SIG{CHILD}.
I see two possible solutions. Either remove the "local" clause on $SIG{CHLD} in ForkManager sub wait_on, OR simply set the following before you call ForkManager:
Best regards, /Bjarne$SIG{CHLD} = sub { };
In reply to Re: Parallel ForkManager error with run_on_wait()
by Anonymous Monk
in thread Parallel ForkManager error with run_on_wait()
by sojourn548
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |