[master] bea5de922 ban lurker: add vsl to wrk

Nils Goroll nils.goroll at uplex.de
Thu Aug 22 15:48:07 UTC 2024


commit bea5de922d826d880d76e32ef13bccb6dc0a0a06
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Thu Aug 22 17:37:28 2024 +0200

    ban lurker: add vsl to wrk
    
    Seen when injecting errors with a custom storage engine: The ban lurker calls
    into the object API, and a storage engine might emit VSL.

diff --git a/bin/varnishd/cache/cache_ban_lurker.c b/bin/varnishd/cache/cache_ban_lurker.c
index 76ac772b9..d9a1899c3 100644
--- a/bin/varnishd/cache/cache_ban_lurker.c
+++ b/bin/varnishd/cache/cache_ban_lurker.c
@@ -420,6 +420,8 @@ ban_lurker(struct worker *wrk, void *priv)
 	AZ(priv);
 
 	VSL_Setup(&vsl, NULL, 0);
+	AZ(wrk->vsl);
+	wrk->vsl = &vsl;
 
 	while (!ban_shutdown) {
 		dt = ban_lurker_work(wrk, &vsl);
@@ -435,6 +437,7 @@ ban_lurker(struct worker *wrk, void *priv)
 		gen = ban_generation;
 		Lck_Unlock(&ban_mtx);
 	}
+	wrk->vsl = NULL;
 	pthread_exit(0);
 	NEEDLESS(return (NULL));
 }


More information about the varnish-commit mailing list