Do you know where your variables are? | |
PerlMonks |
Re^7: Interrupt multi-process program while using MCE::Shared hash: END block code does not (all) runby marioroy (Prior) |
on Apr 09, 2017 at 06:45 UTC ( [id://1187509]=note: print w/replies, xml ) | Need Help?? |
Hi 1nickt, To get the default behavior, one can specify the on_post_exit option. The status code for __DIE__ is 255 typically.
More info on on_post_exit is found here. The die handler for MCE workers is found inside MCE::Core::Worker ( ~ line 649 ). I cannot change the MCE->exit(...) line to MCE::Signal::stop_and_exit('__DIE__'). That will break scripts where MCE is called from inside an eval block.
TODO: When on_post_exit is not specified, have MCE workers abort input due to uncaught exception. Revisit eval. I was unable to get $@ to stick at the manager level. To make this work, I need to call die with the error obtained from the worker at the manager level.
Fortunately, one has control with the on_post_exit handler on what to do: e.g. restart_worker, stop_and_exit.
In Section
Seekers of Perl Wisdom
|
|