[master] 9210cd770 Only count exp_mailed events when actually posting

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Jun 12 13:25:08 UTC 2020


commit 9210cd7709b3026d1ff6bc8ed78e1119d3d3eda5
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Thu Mar 19 13:35:28 2020 +0100

    Only count exp_mailed events when actually posting
    
    When posting to the expiry thread, we wrongly counted exp_mailed also if
    the OC in question was already on the mail queue. This could cause a
    discrepency between the exp_mailed and exp_received counters.

diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index 293ced626..67d5b85ba 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -116,10 +116,10 @@ exp_mail_it(struct objcore *oc, uint8_t cmds)
 			else
 				VSTAILQ_INSERT_TAIL(&exphdl->inbox,
 				    oc, exp_list);
+			VSC_C_main->exp_mailed++;
 		}
 		oc->exp_flags |= cmds | OC_EF_POSTED;
 		AN(oc->exp_flags & OC_EF_REFD);
-		VSC_C_main->exp_mailed++;
 		AZ(pthread_cond_signal(&exphdl->condvar));
 	}
 }


More information about the varnish-commit mailing list