Skip to content
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

If the job dies, it doesn't remove the lock #304

Closed
MaicolBen opened this issue Jul 30, 2018 · 7 comments
Closed

If the job dies, it doesn't remove the lock #304

MaicolBen opened this issue Jul 30, 2018 · 7 comments

Comments

@MaicolBen
Copy link

Describe the bug
This happens with until_executed because the job needs to be executed

Expected behavior
The lock should be released

Current behavior
The lock persists forever

Additional context
Gem version: 6.0.0.rc7

@mhenrixon
Copy link
Owner

That is expected behaviour. You mean the job was retried any number of times configured like retry and not completing? I'll add info in readme how to deal with that.

@mhenrixon
Copy link
Owner

See this section @MaicolBen https://github.com/mhenrixon/sidekiq-unique-jobs/blob/master/README.md#cleanup-dead-locks

@MaicolBen
Copy link
Author

I can use sidekiq_retries_exhausted, but if I adduntil_executed lock, it doesn't enter to sidekiq_retries_exhausted code after moving it to the dead queue. This doesn't happen with until_executing

@MaicolBen
Copy link
Author

Well after some time, I got that the callbacks calls with retry: 0, the documentation is outdated, the method is del instead of delete_by. But it seems the lock is somewhere because isn't fired again:

SidekiqUniqueJobs::Digests.all(pattern: '3606e62e8d702dd382c873f64a543d40') # => []
MyWorker.perform_async(id) # => nil

@mhenrixon
Copy link
Owner

Ah yes! I put the wrong method in the documentation. Will update it in the next PR!

@MaicolBen
Copy link
Author

I did it on #311, do you know why is still locked if the digest doesn't exist anymore?

@mhenrixon
Copy link
Owner

So I was looking into this @MaicolBen. It seems Redis is just not very reliable with the seconds. In my tests a sleep outside the map block seems to work fine but it is unreliable. You probably want something like 1 minute or so for the lock_expiration to make it more robust and reliable.

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

No branches or pull requests

2 participants