You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Didn't see this reported yet, but if you die inside a coderef it escapes outside IPC::Run and starts running from where things were before the fork. You can see that the output gets duplicated weirdly in this example.
#!/usr/bin/env perluse strict;
use warnings;
use IPC::Run qw/harness/;
use Data::Dumper;
use POSIX qw/_exit/;
subworker {
# TODO this could be done via IO::Async somehow now without IPC::Run I think. But it'll take an IO::Async something that supports the namespace stuffmy$in = '';
my$out = '';
my$origpid = $$;
my$h = harness sub {$|++; print"HI\n"; die"Dying inside coderef";}, '<', \$in, '>&', \$out;
my ($start_time, $end_time);
eval {
$h->start();
$start_time = time();
while($h->pumpable()) {
$h->pump_nb();
sleep(0.1); # yield some timedie"Timeout"if (time() - $start_time) > 12;
}
};
$end_time = time();
my$err = $@;
$h->kill_kill; # shouldn't be necessary but it's safeeval {$h->finish();} if$err;
printSTDERR Dumper({out=>$out, pid=>$$, opid=>$origpid});
return$out;
}
worker();
The text was updated successfully, but these errors were encountered:
Didn't see this reported yet, but if you die inside a coderef it escapes outside IPC::Run and starts running from where things were before the fork. You can see that the output gets duplicated weirdly in this example.
The text was updated successfully, but these errors were encountered: