Skip to content

Conversation

@bliof
Copy link

@bliof bliof commented Mar 8, 2020

Problem

You can kill the app in def lock just after the lpop of the
available_key

When that happens the semaphore is gone forever. To fix it you have to
manually delete the exists key.

Expirations also don't help as for some reason the exists key get -1 as a ttl

Solution

The fix is to recreate the keys in redis if there isn't an AVAILABLE or GRABBED key

Related

https://stackoverflow.com/questions/60269868/redis-semaphore-locks-cant-be-released/

ps. I have never used the gem

…ble key

= Problem

You can kill the app in `def lock` just after the lpop of the
available_key

When that happens the semaphore is gone forever. To fix it you have to
manually delete the exists key.

Expirations also don't help as for some reason the exists key get -1 as a ttl

= Solution

The fix is to recreate the keys in redis if there isn't an AVAILABLE or GRABBED key

= Related

https://stackoverflow.com/questions/60269868/redis-semaphore-locks-cant-be-released/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant