diff --git a/lib/sidekiq/launcher.rb b/lib/sidekiq/launcher.rb index 6ff7a087..b6e1fcae 100644 --- a/lib/sidekiq/launcher.rb +++ b/lib/sidekiq/launcher.rb @@ -43,12 +43,12 @@ module Sidekiq watchdog('Launcher#stop') do @done = true Sidekiq::Fetcher.done! - manager.async.stop(:shutdown => true, :timeout => @options[:timeout]) - fetcher.terminate if fetcher.alive? poller.terminate if poller.alive? + manager.async.stop(:shutdown => true, :timeout => @options[:timeout]) manager.wait(:shutdown) + # Requeue everything in case there was a worker who grabbed work while stopped Sidekiq::Fetcher.strategy.bulk_requeue([], @options) end