mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-28 12:22:33 +00:00
One fixed key meant two probes overlapping - two /ready requests, or two instances against the one redis, which is the normal deployment - overwrote each other's value between the write and the read, and each concluded the cache was broken. A readiness probe that reports false negatives under load pulls healthy instances out of the pool, which is worse than not probing. The key now carries eight random bytes. The written value is still read back, because that is what tells a healthy cache apart from one that answers "miss" for everything, and the key is deleted afterwards on a best-effort basis - its error is dropped deliberately, since the verdict is already decided and a cache that cannot delete what it just wrote is not a reason to refuse traffic. The first version of the concurrency test had no teeth: the probes are short enough that the scheduler ran them one after another, so the fixed-key counter-proof passed three times out of three. The fake cache now holds every writer until all of them have written, which makes the interleaving the test is about actually happen. With one key that is a deterministic 15 failures out of 16 - only the last writer's value survives - and with a key per probe, none.