Subject: | start_delay parameter causes FCGI::ProcManager to hang (patch to solve included) |
Date: | Mon, 1 Aug 2011 16:20:06 -0400 |
To: | bug-FCGI-ProcManager [...] rt.cpan.org |
From: | dark_neo [...] Safe-mail.net |
Hi,
Tried to use start_delay parameter for making FCGI::ProcManager ver. 0.19 to not restart dying children too often, like this:
pm_manage(n_processes => 2, start_delay => 2, die_timeout => 30);
and found that now it starts only one child and hangs. Looking at source revealed:
for (my $s = $this->start_delay(); $s; $s = sleep $s) {};
This is perl, v5.10.1, and perldoc -f sleep says:
sleep Causes the script to sleep for EXPR seconds, or forever if no
EXPR. Returns the number of seconds actually slept.
So obviously this is an infinite loop. Here is a patch to solve:
--- ProcManager.pm~ 2011-08-02 03:04:09.000000000 +0000
+++ ProcManager.pm 2011-08-02 03:04:58.000000000 +0000
@@ -228,7 +228,7 @@
last MANAGING_LOOP;
}
- for (my $s = $this->start_delay(); $s; $s = sleep $s) {};
+ for (my $s = $this->start_delay(); $s > 0; $s -= sleep $s) {};
}
# this should block until the next server dies.
Please fix...
Message body is not shown because sender requested not to inline it.