[master] 69f9ca40c cache_fetch: Clarify that we can only replace an object before streaming

Nils Goroll nils.goroll at uplex.de
Mon Aug 4 10:56:05 UTC 2025


commit 69f9ca40ccfda482d10d877165e998c4511aa28d
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Aug 4 12:40:40 2025 +0200

    cache_fetch: Clarify that we can only replace an object before streaming
    
    Motivated by #4371

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 0b3685e45..7cd779037 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -944,6 +944,8 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
 	VSLb_ts_busyobj(bo, "Error", now);
 
 	if (oc->stobj->stevedore != NULL) {
+		// replacing an already fetched object with a "synth" one
+		assert(oc->boc->state < BOS_STREAM);
 		oc->boc->fetched_so_far = 0;
 		ObjFreeObj(bo->wrk, oc);
 	}


More information about the varnish-commit mailing list