You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Sidekiq to run tasks in the background. Some types of tasks use a lock to ensure only one task of the same type is running at any given time. For example, WorkerA has 5 running instances, the requirement is that those instances do not overlap. The way our tasks run, there can be 20+ instances waiting for the lock at the same time.
The race condition seems to happen on lines 42-44 in redis/lock.rb
A bit of background:
I'm using Sidekiq to run tasks in the background. Some types of tasks use a lock to ensure only one task of the same type is running at any given time. For example, WorkerA has 5 running instances, the requirement is that those instances do not overlap. The way our tasks run, there can be 20+ instances waiting for the lock at the same time.
The race condition seems to happen on lines 42-44 in redis/lock.rb
It seems like all threads waiting on the lock suddenly get it when the lock expires.
This is the code I have that produces the problem:
invoked with:
and the output:
The text was updated successfully, but these errors were encountered: