From 540268b73c987e090be6f2b586955ae82933b915 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 22 Aug 2026 10:38:44 -0700 Subject: Log when a cache slot is claimed by a colliding key --- source/cache.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/cache.c') diff --git a/source/cache.c b/source/cache.c index d6e450a..435cc96 100644 --- a/source/cache.c +++ b/source/cache.c @@ -354,6 +354,14 @@ static int process_slot(struct cache_slot *slot) return err; } + // A slot that opened cleanly but holds another key is a collision, + // and two popular pages sharing one slot evict each other on every + // alternating visit. Nothing else makes that visible, because the + // cache keeps working and only quietly stops helping. + if (!err) + log_error("[cgit] cache slot %s holds a different key, " + "consider a larger cache-size\n", slot->path); + // If any part of creating a slot fails the page is still rendered // straight to the client and the caller is told the request succeeded, // because it did. -- cgit v2.8.0