diff --git a/Changes.md b/Changes.md index 43df7c7a..3c31f18c 100644 --- a/Changes.md +++ b/Changes.md @@ -1,6 +1,7 @@ 2.11.3 ----------- +- Fix unclean shutdown leading to duplicate jobs [#897] - Add Korean locale [#890] 2.11.2 diff --git a/lib/sidekiq/middleware/server/retry_jobs.rb b/lib/sidekiq/middleware/server/retry_jobs.rb index d9b7f6fc..8b4bb5e7 100644 --- a/lib/sidekiq/middleware/server/retry_jobs.rb +++ b/lib/sidekiq/middleware/server/retry_jobs.rb @@ -48,6 +48,9 @@ module Sidekiq def call(worker, msg, queue) yield + rescue Sidekiq::Shutdown + # ignore, will be pushed back onto queue + raise rescue Exception => e raise e unless msg['retry'] max_retry_attempts = retry_attempts_from(msg['retry'], DEFAULT_MAX_RETRY_ATTEMPTS)