linsomniac/python-memcached

Fails silently if unable to connect to socket

Closed this issue · 2 comments

There is no indication that a socket is unreachable.

In my case the socket was owned by 'memcache:memcache' with permission 'srwx------' (the default for memcached) yet my client process was run by another user. There appears to be no indication at all that the service was unreachable. I couldn't for the life of my figure out why things weren't being cached from django.. I'm fairly new to this sort of thing.

Yes, python-memcached has a "fail silently" design (historical choice, that way for a long time as I recall), so that the loss of a memcache server doesn't bring your infrastructure down completely. Though, presumably, it will make it run more slowly!

There are other client libraries which will raise an error on connection failure if that is desired.

Sorry I don't see how this binding would "bring your infrastructure down completely" simply by logging a useful error message. I fixed it by using pylibmc. Thanks for the response.