New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Timeout for MemcacheLock #54

Closed
sqlalchemy-bot opened this Issue Dec 16, 2013 · 9 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented Dec 16, 2013

Migrated issue, originally created by Anonymous

Similar to the REDIS backend, the Memcache backend supports distributed locking. It looks like there is no lock_timeout configurable for the distributed lock in Memcached:

https://bitbucket.org/zzzeek/dogpile.cache/src/4c19440ad41a8f36ddf6ae41618a7f3b7fb8dd32/dogpile/cache/backends/memcached.py?at=master#cl-34

Compared to redis: https://bitbucket.org/zzzeek/dogpile.cache/src/4c19440ad41a8f36ddf6ae41618a7f3b7fb8dd32/dogpile/cache/backends/redis.py?at=master#cl-106

This means that in some cases you could achieve a state with bad locking that could cause a (near) endless loop.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Dec 16, 2013

Morgan Fainberg () wrote:

Whoops, wasn't logged in when I reported this. Tagging my name to it. If i get a chance in the next couple days I'll submit a pull request.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Dec 17, 2013

Michael Bayer (zzzeek) wrote:

it's easy for us to support timeout for the redis lock because we are using the lock implementation that comes with the Python redis client. If such a lock exists for memcached, that might be preferable (e.g. if there's something on pypi which is widely used and super-well-written, I'd consider it). otherwise, if submitting a pull req please try to make sure the timeout parameter is tested and does what it advertises.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Dec 17, 2013

Morgan Fainberg () wrote:

I have some tentative code that I'm using in a wrapper for dogpile. I'll see if I can distill it. Of course, testing in this case is super important. I will 2x check to see if we have some "lock" mechanism that makes sense to use on pypi before trying to use the more-domain specific code I've developed.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Oct 24, 2014

Matthew Phipps () wrote:

Morgan, did you figure this out?

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Mar 13, 2015

Morgan Fainberg () wrote:

Finally got around to contributing the code, This is addressed in pull-request: https://bitbucket.org/zzzeek/dogpile.cache/pull-request/31/add-in-timeout-for-memcache-distributed/diff

@sqlalchemy-bot

This comment has been minimized.

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Oct 19, 2015

Michael Bayer (zzzeek) wrote:

  • changelog for ref #54

2af09b2

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Oct 19, 2015

Michael Bayer (zzzeek) wrote:

pr is merged

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented Oct 19, 2015

Changes by Michael Bayer (zzzeek):

  • changed status to closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment