1
0
Fork 0
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:
Mike Perham 2016-03-04 09:25:13 -08:00
parent d60e68c669
commit b0f1647178

View file

@ -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.