-
Notifications
You must be signed in to change notification settings - Fork 221
Open
Description
In the get_or_set()
implementation, the dogpile lock never expires. In some edge cases it can creates some issues, here is an example:
if value is None: |
- L410: value is None -> we create a dogpile lock
- L424: for some reason, the
expire
never succeeded (for instance, the client failed to get a connection in the connection pool: I believe this is what happened in my particular case)
In this particular case, the Redis cache is in a state where the dogpile lock will never get released: evert future calls to get_or_set()
will return None, until someone manually releases the lock. This is not simple to debug for someone not familiar with the dogpile lock, and worst, it requires manual action to return to a "clean" state.
To avoid that I'd like to add an extra argument dogpile_timeout
to the get_or_set
value. I'll work on a PR to add that feature, but I'd be happy to have opinions about this idea first.
Metadata
Metadata
Assignees
Labels
No labels