From: phk Date: Mon, 18 Sep 2006 09:33:10 +0000 (+0000) Subject: Increase CLI respone timeout to 5 seconds and tell that X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6805106cf4e3215e7a3d5e334a097cac1e1d2ca5;p=varnish Increase CLI respone timeout to 5 seconds and tell that a ping has failed before we kill the child. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1067 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/mgt_child.c b/varnish-cache/bin/varnishd/mgt_child.c index f9e9b24b..7a029e95 100644 --- a/varnish-cache/bin/varnishd/mgt_child.c +++ b/varnish-cache/bin/varnishd/mgt_child.c @@ -86,8 +86,10 @@ child_poker(struct ev *e, int what) (void)what; if (child_state != CH_RUNNING) return (1); - if (child_pid > 0 && mgt_cli_askchild(NULL, NULL, "ping\n")) + if (child_pid > 0 && mgt_cli_askchild(NULL, NULL, "ping\n")) { + fprintf(stderr, "Child not responding to ping\n"); kill(child_pid, SIGKILL); + } return (0); } diff --git a/varnish-cache/bin/varnishd/mgt_cli.c b/varnish-cache/bin/varnishd/mgt_cli.c index 64f4f45b..536c7f77 100644 --- a/varnish-cache/bin/varnishd/mgt_cli.c +++ b/varnish-cache/bin/varnishd/mgt_cli.c @@ -212,7 +212,7 @@ mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...) return (CLIS_COMMS); } - i = cli_readres(cli_i, &u, resp, 3.0); + i = cli_readres(cli_i, &u, resp, 5.0); if (status != NULL) *status = u; return (u == CLIS_OK ? 0 : u);