1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Terminate fetcher async'ly so it doesn't block shutdown progress

This commit is contained in:
Mike Perham 2012-04-24 19:58:52 -07:00
parent c2826744b3
commit 06b6aa4d87
2 changed files with 8 additions and 1 deletions

View file

@ -39,7 +39,7 @@ module Sidekiq
timeout = options[:timeout]
@done = true
@fetcher.terminate if @fetcher.alive?
@fetcher.terminate! if @fetcher.alive?
logger.info { "Shutting down #{@ready.size} quiet workers" }
@ready.each { |x| x.terminate if x.alive? }

View file

@ -38,6 +38,13 @@ class TestManager < MiniTest::Unit::TestCase
result = q.timed_pop(1.0)
assert_equal 'done', result
mgr.stop
mgr.terminate
# Gross bloody hack because I can't get the actor threads
# to shut down cleanly in the test. Need @bascule's help here.
(Thread.list - [Thread.current]).each do |t|
t.raise Interrupt
end
end
end
end