CLEANUP: cache: align the cache_hint_hits increment with its siblings
Some checks failed
Contrib / admin/halog/ (push) Has been cancelled
Contrib / dev/flags/ (push) Has been cancelled
Contrib / dev/haring/ (push) Has been cancelled
Contrib / dev/hpack/ (push) Has been cancelled
Contrib / dev/poll/ (push) Has been cancelled
FreeBSD / clang (push) Has been cancelled
VTest / Generate Build Matrix (push) Has been cancelled
Windows / Windows, gcc, all features (push) Has been cancelled
VTest / (push) Has been cancelled

For the sake of consistency, increment cache_hint_hits the same way as the
surrounding cache counters instead of going through a temporary pointer.

No functional change, and nothing to backport.
This commit is contained in:
Maxime Henrion 2026-07-10 17:55:28 -04:00 committed by Willy Tarreau
parent 8d2381c5ee
commit 5468ef0d75

View file

@ -2657,17 +2657,14 @@ enum act_return http_action_req_cache_use(struct act_rule *rule, struct proxy *p
if (hint_buf && b_data(hint_buf) > 0 &&
cache_emit_early_hints(s, b_orig(hint_buf), b_data(hint_buf))) {
long long *ctr = NULL;
if (px == strm_fe(s)) {
if (px->fe_counters.shared.tg)
ctr = &px->fe_counters.shared.tg[tgid - 1]->p.http.cache_hint_hits;
_HA_ATOMIC_INC(&px->fe_counters.shared.tg[tgid - 1]->p.http.cache_hint_hits);
}
else {
if (px->be_counters.shared.tg)
_HA_ATOMIC_INC(&px->be_counters.shared.tg[tgid - 1]->p.http.cache_hint_hits);
}
else if (px->be_counters.shared.tg)
ctr = &px->be_counters.shared.tg[tgid - 1]->p.http.cache_hint_hits;
if (ctr)
_HA_ATOMIC_INC(ctr);
}
/* In case of Vary, we could have multiple entries with the same