mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Fix rare networking edge case that can cause scheduler thread to get into a bad state, fixes #2866
This commit is contained in:
parent
d60e68c669
commit
b0f1647178
1 changed files with 7 additions and 0 deletions
|
@ -86,6 +86,13 @@ module Sidekiq
|
|||
def wait
|
||||
@sleeper.pop(random_poll_interval)
|
||||
rescue Timeout::Error
|
||||
# expected
|
||||
rescue => ex
|
||||
# if poll_interval_average hasn't been calculated yet, we can
|
||||
# raise an error trying to reach Redis.
|
||||
logger.error ex.message
|
||||
logger.error ex.backtrace.first
|
||||
sleep 5
|
||||
end
|
||||
|
||||
# Calculates a random interval that is ±50% the desired average.
|
||||
|
|
Loading…
Reference in a new issue