Open delthas opened 1 month ago
cc @nigoroll
Yes, I think it basically is the same race as the one closed in #3957
Does that mean the fix would just be the following?
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -658,6 +658,9 @@ VBP_Control(const struct backend *be, int enable)
Lck_Lock(&vbp_mtx);
if (enable) {
+ if (vt->heap_idx != VBH_NOIDX) {
+ VBH_delete(vbp_heap, vt->heap_idx);
+ }
assert(vt->heap_idx == VBH_NOIDX);
vt->due = VTIM_real();
vbp_heap_insert(vt);
Does that mean the fix would just be the following?
FTR: @delthas reported on IRC that the patch avoids the panic, which is helpful information, thank you.
@delthas could you share more details about your tests, like, for example, a script you are using?
@delthas could you try #4115 ?
I'm using Varnish 7.5.0 and the 7.5 branch of libvmod-dynamic.
I'm stressing a Varnish with a simple VCL with many dynamic backends with probes, reloading and restarting many times over multiples hours and gathering any issues. I've had one repeated panic:
This looks very close to https://github.com/varnishcache/varnish-cache/pull/3957 (itself fixing https://github.com/nigoroll/libvmod-dynamic/issues/100), but even with a version including the fix, I'm getting this assert. In that PR the crash is
Assert error in VBP_Remove(): Condition(vt->heap_idx == VBH_NOIDX) not true.
, here it'sAssert error in VBP_Control(): Condition(vt->heap_idx == VBH_NOIDX) not true.
, so in a slightly different place.