[6.0] a12a65c3b Only count exp_mailed events when actually posting

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


commit a12a65c3b20bc145b931c8ad13e085bac2112bd8
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 e9f12e7b2..25d0c6e0e 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -112,10 +112,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