[master] f03919325 fetch: Atomically capture stale_oc state

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Oct 27 14:09:06 UTC 2025


commit f03919325dc75d3cae8c80d66209d4f174469381
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Oct 3 10:28:35 2025 +0200

    fetch: Atomically capture stale_oc state
    
    It should be safe as it was because there shouldn't be a transition from
    BOS_FINISHED to BOS_FAILED, but now that it can be atomic, it should not
    only be safe but also future-proof. It originally matched ignore_state
    from the coccinelle patch because of the separate boc variable, and
    had to be manually edited.

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index d59f9e47c..0bfd34637 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -894,8 +894,7 @@ vbf_stp_condfetch(struct worker *wrk, struct busyobj *bo)
 		VSLb(bo->vsl, SLT_Notice,
 		    "vsl: Conditional fetch wait for streaming object");
 		/* XXX: We should have a VCL controlled timeout here */
-		(void)ObjWaitState(stale_oc, BOS_FINISHED);
-		stale_state = stale_boc->state;
+		stale_state = ObjWaitState(stale_oc, BOS_FINISHED);
 		HSH_DerefBoc(bo->wrk, stale_oc);
 		stale_boc = NULL;
 		if (stale_state != BOS_FINISHED) {


More information about the varnish-commit mailing list