[6.0] 37b6567bc Decrease sleep time when waiting for child to die.
Reza Naghibi
reza at naghibi.com
Tue Apr 20 18:26:05 UTC 2021
commit 37b6567bc01adedc0bd1b5cf70070e4bf32c6f08
Author: Simon <simon at devsn.se>
Date: Tue Apr 6 13:13:28 2021 +0000
Decrease sleep time when waiting for child to die.
diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index bc5c00ec2..c152ff9f1 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -511,11 +511,11 @@ mgt_reap_child(void)
XXXAN(vsb);
/* Wait for child to die */
- for (i = 0; i < mgt_param.cli_timeout; i++) {
+ for (i = 0; i < mgt_param.cli_timeout * 10; i++) {
r = waitpid(child_pid, &status, WNOHANG);
if (r == child_pid)
break;
- (void)sleep(1);
+ (void)usleep(100000);
}
if (r == 0) {
VSB_printf(vsb, "Child (%jd) not dying, killing", (intmax_t)r);
More information about the varnish-commit
mailing list