Commit 5b6377e3 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Get the VCL state tracking precise enough to pass our testcases

parent d50db264
......@@ -997,8 +997,7 @@ vcl_cli_discard(struct cli *cli, const char * const *av, void *priv)
free(vcl->loaded_name);
AZ(errno=pthread_rwlock_destroy(&vcl->temp_rwl));
FREE_OBJ(vcl);
} else {
assert(vcl->temp == VCL_TEMP_COLD);
} else if (vcl->temp == VCL_TEMP_COLD) {
VCL_Poll();
}
}
......
......@@ -750,7 +750,7 @@ mcf_vcl_discard(struct cli *cli, const char * const *av, void *priv)
(void)mgt_vcl_setstate(cli, vp, VCL_STATE_COLD);
if (MCH_Running()) {
/* XXX If this fails the child is crashing, figure that later */
assert(!vp->warm);
assert(vp->state != VCL_STATE_WARM);
(void)mgt_cli_askchild(&status, &p, "vcl.discard %s\n", av[2]);
free(p);
}
......
......@@ -17,7 +17,7 @@ varnish v1 -cliok "vcl.state vcl1 cold"
# We should now see it as cooling
delay 1
varnish v1 -cliexpect "auto/cooling.*vcl1" vcl.list
varnish v1 -cliexpect "cold/cooling.*vcl1" vcl.list
# It can't be warmed up yet
delay 1
......@@ -25,7 +25,7 @@ varnish v1 -cliexpect "vmod-debug ref on vcl1" "vcl.state vcl1 warm"
# It will eventually cool down
delay 2
varnish v1 -cliexpect "auto/cold.*vcl1" vcl.list
varnish v1 -cliexpect "cold/cold.*vcl1" vcl.list
# At this point it becomes possible to warm up again
varnish v1 -cliok "vcl.state vcl1 warm"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment