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
Description about lock_timeout for while executing strategy says:
NOTE Unless this job is configured with a lock_timeout: nil or lock_timeout: > 0 then all jobs that are attempted to be executed will just be dropped without waiting.
But if i run a simple test worker with option lock_timeout: nil many times
3.times{TestWorker.perform_async}
i see in console result(9 lines) from all executed jobs.
When i set lock_timeout: 2 it works nice, i see result only from first job(3 lines).
It seems to me that you might not understand how Sidekiq works. Let me try and explain it to you.
If you think of WhileExecuting as WhilePerform or DuringWorkerPerfrom you quickly realize that the job isn't locked/prevented when it is pushed to sidekiq. Only when the Sidekiq::Processor is picking the job off the queue.
This means that if you set lock_timeout: nil each sidekiq worker will wait indefinitely for a lock to become available (dangerous as you might actually run out of sidekiq workers available to process jobs).
When you say that you will wait 2 seconds and the job sleeps for 1 second that should mean that if you send in 6 jobs, 3 of those will complete. If you set it to nil, all of those jobs should complete.
If you set it to zero, most likely, only one of them will complete as the others are dropped because they are considered duplicates.
Description about
lock_timeout
forwhile executing
strategy says:But if i run a simple test worker with option
lock_timeout: nil
many timesi see in console result(9 lines) from all executed jobs.
When i set
lock_timeout: 2
it works nice, i see result only from first job(3 lines).Worker class
Seems this is a typo in description, or not?
The text was updated successfully, but these errors were encountered: