Subject: | Destroy method leave the browser as zombie process |
Unfortunatebly I need to harvesting a lot and a memory leak somewhere is stucking me, so I'm recreate de mech entirely but zombies ate my whole system.
After https://metacpan.org/source/CORION/WWW-Mechanize-Chrome-0.32/lib/WWW/Mechanize/Chrome.pm#L790 and https://metacpan.org/source/CORION/WWW-Mechanize-Chrome-0.32/lib/WWW/Mechanize/Chrome.pm#L1396 is needed a wait to avoid zombie creation.
Thank you.
Subject: | Chrome.pm.patch |
--- /usr/share/perl5/WWW/Mechanize/Chrome.pm~ 2019-05-17 08:34:40.000000000 -0400
+++ /usr/share/perl5/WWW/Mechanize/Chrome.pm 2019-06-12 13:06:11.442306481 -0400
@@ -788,6 +788,7 @@
if( $self->{ kill_pid } and my $pid = delete $self->{ pid }) {
local $SIG{CHLD} = 'IGNORE';
kill 'SIGKILL' => $pid;
+ waitpid $pid, 0;
};
croak $err;
}
@@ -1370,6 +1371,7 @@
if( $pid ) {
local $SIG{CHLD} = 'IGNORE';
kill 'SIGKILL' => $pid;
+ waitpid $pid, 0;
};
%{ $_[0] }= (); # clean out all other held references
}