Resolve "Hanging scan sequence"
Closes #2423 (closed) #2428 (closed)
There were two reasons for hanging tests.
-
GroupingMaster.wait_all_published
hangs when nobody is iterating overGroupingMaster
-
Redis hangs when making new connections (#2428 (closed)). In the end this was most likely caused by stopping the caching invalidation greenlet through closing the pipe instead of writing to it.
In addition to the second issue, I made a mistake with Redis refactoring, thinking that multiple connections could share the same cache. But in fact they invalidate each other. I refactored so that:
-
RedisCache
owns one connection-pair when connected (1 pubsub for invalidation and 1 tracking to be used as the caching connection) -
CachingRedisDbProxy
owns oneRedisCache
. After disabling caching (e.g. done at the end of a scan) the proxy behaves like a normalRedisDbProxy