[master] 60e16f2f9 Listen to dying child

Nils Goroll nils.goroll at uplex.de
Mon Jul 3 14:54:05 UTC 2023


commit 60e16f2f91ca4b5fc4d151e3c78e96bdf26323bc
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Jul 3 16:51:34 2023 +0200

    Listen to dying child
    
    An r3940 vtest failure on freebsd seems to suggest that the child
    does not terminate while blocking in a write.
    
    ***  v1    debug|Error: Child (74042) Panic at: Mon, 03 Jul 2023 13:40:40 GMT
    ***  v1    debug|Assert error in CLI_Run(), cache/cache_cli.c line 102:
    ***  v1    debug|  Condition((VCLI_WriteResult(heritage.cli_out, CLIS_OK, \"Ready\")) == 0) not true.
    
    This might need another iteration.

diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index 7edd7a844..6b7c2b0e7 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -558,8 +558,10 @@ mgt_reap_child(void)
 	vsb = VSB_new_auto();
 	XXXAN(vsb);
 
+	(void)VFIL_nonblocking(child_output);
 	/* Wait for child to die */
 	for (i = 0; i < mgt_param.cli_timeout * 10; i++) {
+		(void)child_listener(NULL, VEV__RD);
 		r = waitpid(child_pid, &status, WNOHANG);
 		if (r == child_pid)
 			break;


More information about the varnish-commit mailing list