Remove GlobalLock from Redis model cache implementation in
favor of 'nx=True' when setting the key.
Signed-off-by: Alec Merdler <alecmerdler@gmail.com>
Adds implementation of DataModelCache interface backed by Redis.
All containers in a Quay cluster deployment will share a single
model cache, rather than each container using its own cache.
Signed-off-by: Alec Merdler <alecmerdler@gmail.com>
pymemcache is apparently not thread safe, so our reuse of the client
was causing the occasional hang on read. This change has us open a new
connection per request, and then close it once complete. We also make
sure to close the DB connection before making the memcache connection,
in case the memcache connection takes a bit of time
We should investigate switching to the PooledClient library for reusing
connections (safely) once we verify this change works