Hello all, The patch in the attachment backports commit 2144dc78, a fix for mgt_cli.c, to version 3.0.6. The fix catches one of conditions for calling MGT_Child_Cli_Fail() that had previously been missed. The patch would have to be applied to the 3.0 branch.
When the CLI between management and child processes gets out of sync, MGT_Child_Cli_Fail() causes the CLI connection to be closed and re-opened. We were seeing the effect (on both 3.0.3 and 3.0.6) that 'varnishadm vcl.list' occasionally returned the output of backend.list -- backend.list was being called by monitoring tools at the same time. The problem has gone away since we applied the patch. So if there's ever a 3.0.7, then I suggest that this fix be included. Best, Geoff -- ** * * UPLEX - Nils Goroll Systemoptimierung Scheffelstraße 32 22301 Hamburg Tel +49 40 2880 5731 Mob +49 176 636 90917 Fax +49 40 42949753 http://uplex.de
From 2ac21c7fbe4c2cb10c0fd3fd8018f546e42ce943 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp <[email protected]> Date: Sun, 13 Nov 2011 22:02:44 +0000 Subject: [PATCH 1/1] Use better criteria for determining if child CLI connection is hosed. Backports commit 2144dc78 for Varnish 3.0.6 (by Geoff) --- bin/varnishd/mgt_cli.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/varnishd/mgt_cli.c b/bin/varnishd/mgt_cli.c index 7b27e98..da22660 100644 --- a/bin/varnishd/mgt_cli.c +++ b/bin/varnishd/mgt_cli.c @@ -172,7 +172,8 @@ mcf_askchild(struct cli *cli, const char * const *av, void *priv) return; } VSB_delete(vsb); - (void)VCLI_ReadResult(cli_i, &u, &q, params->cli_timeout); + if (VCLI_ReadResult(cli_i, &u, &q, params->cli_timeout)) + MGT_Child_Cli_Fail(); VCLI_SetResult(cli, u); VCLI_Out(cli, "%s", q); free(q); @@ -221,11 +222,10 @@ mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...) { return (CLIS_COMMS); } - (void)VCLI_ReadResult(cli_i, &u, resp, params->cli_timeout); + if (VCLI_ReadResult(cli_i, &u, resp, params->cli_timeout)) + MGT_Child_Cli_Fail(); if (status != NULL) *status = u; - if (u == CLIS_COMMS) - MGT_Child_Cli_Fail(); return (u == CLIS_OK ? 0 : u); } -- 1.7.10.4
signature.asc
Description: OpenPGP digital signature
_______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
