Skip to content

Max expiration for locks #593

@donaldpiret

Description

@donaldpiret

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Looking at the feature in Sidekiq enterprise (https://github.com/mperham/sidekiq/wiki/Ent-Unique-Jobs) they seem to have a maximum amount of time the lock will be valid for (eg. lock is unlocked when the job is completed or this deadline is reached).
Based on what I'm seeing in the documentation the lock_ttl option here works differently in that it describes a minimum unlock time rather than a maximum? (at least if I'm understanding the docs correctly?)

We are trying to execute jobs using sidekiq-cron regularly but ensure that no overlapping jobs are happening. I'm currently not able to figure out a configuration that will work 100% of the time to achieve this. Most of the time my jobs end up getting stuck without the ability to continue.

Describe the solution you'd like
A clear and concise description of what you want to happen.
Can we get a lock_max_ttl option that will determine what a lock's max lifetime is? eg. if this lock is still around after this amount of time assume it is stuck and clear it.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Tried until_executed, until_and_while_executing with various client and server options, but not sure I understand how these are supposed to behave for each lock type, or something really wrong is happening that is causing my jobs to always be stuck.

Additional context
Add any other context or screenshots about the feature request here.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions