Skip to content

Prevent Jobs from deleting mutexes they don't own#96

Merged
mhenrixon merged 1 commit intomhenrixon:masterfrom
pik:bug/unlock-mutex
Jul 30, 2015
Merged

Prevent Jobs from deleting mutexes they don't own#96
mhenrixon merged 1 commit intomhenrixon:masterfrom
pik:bug/unlock-mutex

Conversation

@pik
Copy link
Contributor

@pik pik commented Jul 27, 2015

Hello - so this should solve #94. The jid should already be sufficiently unique for each job and both server and client middleware have access to this.

Using the LUA script would be preferable since it saves a back-and-forth trip to the server, but if there users of sidekiq-unique-jobs with old versions of redis -- perhaps it would make sense to use the conn.watch version by default. (It's included for the tests anyways since mock-redis does not support lua scripts).

 * uses jid for redis mutex to prevent deletion of a mutex owned
   by another job after key expire.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea using LUA for this!

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.

2 participants