diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-11-06 02:24:10 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-11-06 02:36:27 +0000 |
commit | 4c5aefa112a42d293300ba8c1f31230b6163ca76 (patch) | |
tree | 9eaad400971c6f068c77d53ccde25ba7d0241caf /lib/yahns/worker.rb | |
parent | 0151fa2bcba2371a36d22d072ca756f2959de1e0 (diff) | |
download | yahns-4c5aefa112a42d293300ba8c1f31230b6163ca76.tar.gz |
Double SIGQUIT defeats the use of graceful shutdown. We must not watch the worker pipe again for readability after we've initiated graceful shutdown.
Diffstat (limited to 'lib/yahns/worker.rb')
-rw-r--r-- | lib/yahns/worker.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/yahns/worker.rb b/lib/yahns/worker.rb index 0d25acc..9b1bb8a 100644 --- a/lib/yahns/worker.rb +++ b/lib/yahns/worker.rb @@ -23,8 +23,11 @@ class Yahns::Worker # :nodoc: # This causes the worker to gracefully exit if the master # dies unexpectedly. def yahns_step - @to_io.kgio_tryread(11) == nil and Process.kill(:QUIT, $$) - :wait_readable + if @to_io.kgio_tryread(11) == nil + Process.kill(:QUIT, $$) + @to_io.close + end + :ignore end # worker objects may be compared to just plain Integers |