Skip Menu |

This queue is for tickets about the Object-Remote CPAN distribution.

Report information
The Basics
Id: 129951
Status: new
Priority: 0/
Queue: Object-Remote

People
Owner: Nobody in particular
Requestors: JAMAICA [...] cpan.org
Cc:
AdminCc:

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



Subject: Missing documentation about avoiding zombie processes
While building a script that connects to a lot of hosts one by one, I saw an increasing number of zombie child processes (ssh processes). After digging around a little bit, I found out, that Object::Remote does not handle the child process cleanup.

I think you should update the documentation, that this tasks has to be done in the main process, either by settings the SIGCHLD handler to 'IGNORE' or by doing a `wait` or `waitpid` call, to cleanup the processes.

It should also be noted, that Object::Remote->connect method return undef, if the connection fails and it's not possible to call the child_pid method to get the pid of the failed connection (for the SSH connector).


Example:

use Object::Remote;

my @hosts = qw(host1 host2 host3 host4 host5);

foreach my $host (@hosts) {
  my $conn = Object::Remote->connect('user@' . $host);
  sleep(5);
}

​If you monitor your processes with `htop`, you could see an increasing number of zombie childs below the parent.