Cache Invalidation Across 10 Processes: A Generation Counter
·5 mins
Ten worker processes share a port. A write that clears the cache on one worker leaves the other nine serving stale results. Fixed with a shared multiprocessing.Value generation counter checked on every request.