[master] 7df0a8fcf cache_expire: Add assertion

Nils Goroll nils.goroll at uplex.de
Sat Jun 14 20:33:05 UTC 2025


commit 7df0a8fcff3d79876fa1170980878cdabda9c9e2
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Jun 14 15:53:44 2025 +0200

    cache_expire: Add assertion
    
    the only way an oc can end up on in the inbox is through exp_mail_it(), and it
    sets the flag.

diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index 0aaa354f6..8e459140b 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -440,6 +440,7 @@ exp_thread(struct worker *wrk, void *priv)
 		CHECK_OBJ_ORNULL(oc, OBJCORE_MAGIC);
 		if (oc != NULL) {
 			assert(oc->refcnt >= 1);
+			assert(oc->exp_flags & OC_EF_POSTED);
 			VSTAILQ_REMOVE(&ep->inbox, oc, objcore, exp_list);
 			VSC_C_main->exp_received++;
 			tnext = 0;


More information about the varnish-commit mailing list