From f36d4bc7bb8372b806de0b8611ee9c4da442d3d1 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 20 Aug 2026 00:03:33 -0700 Subject: Log when a colliding key claims a cache slot --- source/cache.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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 2.12.1