[master] 78ccf7bd9 Decrease sleep time when waiting for child to die.
Poul-Henning Kamp
phk at FreeBSD.org
Tue Apr 6 14:02:04 UTC 2021
commit 78ccf7bd9c62ef434bc0b11011ae6f63ed2ccf62
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 e55e6ca5d..84f3c182e 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -519,11 +519,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