Skip Menu |
 

This queue is for tickets about the Net-Daemon CPAN distribution.

Report information
The Basics
Id: 82539
Status: new
Priority: 0/
Queue: Net-Daemon

People
Owner: Nobody in particular
Requestors: kas [...] fi.muni.cz
Cc:
AdminCc:

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



Subject: Net::Daemon fork mode on Windows/Strawberry Perl
Download (untitled) / with headers
text/plain 633b
We are trying to use a RPC::PlServer service on a Windows machine running Strawberry Perl. RPC::PlServer inherits from Net::Daemon. We use fork mode, and the server keeps dying with "resource not available" after ~64th connection. From the list of processes/threads we think the child processes (threads under Windows) are not reaped when they exit(). Using the standard technique of ignoring child process states (i.e. $SIG{CHLD} = 'IGNORE'; ) did not help. Reaping the child processes explicitly using waitpid() helped, though. Please consider applying the attached patch or using it as a basis for more general solution. Thanks!
Subject: Net-Daemon.diff
Download Net-Daemon.diff
text/x-diff 572b
--- v0.48/Net/Daemon.pm 2011-03-09 17:41:12.000000000 +0100 +++ new/Net/Daemon.pm 2013-01-07 20:11:18.000000000 +0100 @@ -33,6 +33,8 @@ package Net::Daemon; +use POSIX ":sys_wait_h"; + $Net::Daemon::VERSION = '0.48'; # Dummy share() in case we're >= 5.10. If we are, require/import of @@ -491,7 +493,10 @@ } else { my $pid = fork(); die "Cannot fork: $!" unless defined $pid; - return if $pid; # Parent + if ($pid) { # Parent + 1 while (waitpid(-1,WNOHANG) > 0); + return; + } $self->$method(@args); # Child exit(0); }


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.