mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
health: Make cache health check work with mcrouter.
McRouter sends a SERVER_ERROR for keys starting with a double underscore except for keys in the special "__mcrouter__" namespace. We were ignoring the cache miss anyway, so lets just check for mcrouter's health everywhere and we'll still get the desired result.
This commit is contained in:
@@ -69,7 +69,9 @@ class HealthController(MinimalController):
|
||||
# libmemcached doesn't support UDP get/fetch operations
|
||||
continue
|
||||
mc = pylibmc.Client([server], behaviors=behaviors)
|
||||
mc.get("__health_check_%s__" % server)
|
||||
# it's ok that not all caches are mcrouter, we'll just ignore
|
||||
# the miss either way
|
||||
mc.get("__mcrouter__.version")
|
||||
results[server] = "OK"
|
||||
except pylibmc.Error as e:
|
||||
g.log.warning("Health check for %s FAILED: %s", server, e)
|
||||
|
||||
Reference in New Issue
Block a user