[6.0] 72f249e42 fix vcl temperature after failing warmup event
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Wed Feb 6 08:40:13 UTC 2019
commit 72f249e427a5e02e3750a95988ed8276211e31ae
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Sat Nov 17 15:06:41 2018 +0100
fix vcl temperature after failing warmup event
Fixes #2835
diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index ae846e0a6..1d3583612 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -504,10 +504,12 @@ vcl_set_state(VRT_CTX, const char *state)
else {
vcl->temp = VCL_TEMP_WARM;
i = vcl_send_event(ctx, VCL_EVENT_WARM);
- if (i == 0)
+ if (i == 0) {
vcl_BackendEvent(vcl, VCL_EVENT_WARM);
- else
- AZ(vcl->conf->event_vcl(ctx, VCL_EVENT_COLD));
+ break;
+ }
+ AZ(vcl->conf->event_vcl(ctx, VCL_EVENT_COLD));
+ vcl->temp = VCL_TEMP_COLD;
}
break;
default:
diff --git a/bin/varnishtest/tests/v00003.vtc b/bin/varnishtest/tests/v00003.vtc
index ff218f28c..6236f28f1 100644
--- a/bin/varnishtest/tests/v00003.vtc
+++ b/bin/varnishtest/tests/v00003.vtc
@@ -88,6 +88,8 @@ varnish v1 -expect !VBE.vcl1.default.happy
varnish v1 -cliok "param.set max_esi_depth 42"
varnish v1 -clierr 300 "vcl.state vcl1 warm"
+varnish v1 -cliexpect "available *cold/cold *[0-9]+ *vcl1\\s+active *warm/warm *[0-9]+ *vcl2" "vcl.list"
+
# A warm-up failure can also fail a child start
varnish v1 -cliok stop
varnish v1 -cliok "vcl.state vcl1 warm"
More information about the varnish-commit
mailing list