[6.0] 039f65805 Execute EXP_Insert after unbusy in HSH_Insert

Reza Naghibi reza at naghibi.com
Wed Apr 21 18:26:06 UTC 2021


commit 039f65805c75a3e8e7a6cb1f2ff7a8e86dc8c437
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Mon Mar 23 14:23:02 2020 +0100

    Execute EXP_Insert after unbusy in HSH_Insert
    
    This makes the order of events the same as on real cache insertions.

diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 38ef503ba..97dca05a2 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -299,7 +299,6 @@ HSH_Insert(struct worker *wrk, const void *digest, struct objcore *oc,
 
 	BAN_RefBan(oc, ban);
 	AN(oc->ban);
-	EXP_Insert(wrk, oc);
 
 	/* Move the object first in the oh list, unbusy it and run the
 	   waitinglist if necessary */
@@ -311,6 +310,8 @@ HSH_Insert(struct worker *wrk, const void *digest, struct objcore *oc,
 		hsh_rush1(wrk, oh, &rush, HSH_RUSH_POLICY);
 	Lck_Unlock(&oh->mtx);
 	hsh_rush2(wrk, &rush);
+
+	EXP_Insert(wrk, oc);
 }
 
 /*---------------------------------------------------------------------


More information about the varnish-commit mailing list