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

NullLock.acquire takes exactly 1 argument (2 given) #97

Closed
sqlalchemy-bot opened this Issue May 26, 2016 · 3 comments

Comments

Projects
None yet
1 participant
@sqlalchemy-bot

sqlalchemy-bot commented May 26, 2016

Migrated issue, originally created by Jamie Lennox (jamielennox)

So this is a transient bug in a keystone deployment i'm working on that i haven't figured out the source of yet, however the fix i think is reasonably clear.

The Null cache backed's NullLock.acquire does not accept any arguments [1] however it's called with wait=True [2] and so gives a ValueError. I'm not sure how this went unnoticed for so long or why I'm only seeing it on some runs, but the acquire function should definitely be accepting the wait parameter like other lock implementations.

[1] https://bitbucket.org/zzzeek/dogpile.cache/src/87965ada186f9b3a4eb7ff033a2e31437d5e9bc6/dogpile/cache/backends/null.py?at=master&fileviewer=file-view-default#null.py-20

[2] https://bitbucket.org/zzzeek/dogpile.core/src/e9011d84952fda433b45bd4e0ef7a11bd764f582/dogpile/core/dogpile.py?at=master&fileviewer=file-view-default#dogpile.py-122

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 26, 2016

Changes by Jamie Lennox (jamielennox):

  • edited description
@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 26, 2016

Michael Bayer (zzzeek) wrote:

NullLock.acquire should accept wait parameter, return boolean

The interface for acquiring locks specifies that they should accept and
default to wait=True. NullLock wasn't implementing this correctly.
Additionally, the acquire() function needs to return a boolean value
to indicate that the lock was acquired (which in the case of NullLock
is unconditional).

Fixes: #97

Change-Id: I45487cd602b562242e425395728a9ed7e78d797e
Pull-request: https://bitbucket.org/zzzeek/dogpile.cache/pull-requests/50

97add35

@sqlalchemy-bot

This comment has been minimized.

sqlalchemy-bot commented May 26, 2016

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