about summary refs log tree commit homepage
path: root/lib/yahns/server_mp.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2013-10-19 23:43:59 +0000
committerEric Wong <normalperson@yhbt.net>2013-10-20 00:09:04 +0000
commitcd84e2ccbdf29b908c7d4711528d61bac05505bb (patch)
tree03e5cfd47e9a445094ccd559e2dd99095c0b422d /lib/yahns/server_mp.rb
parentd4805769eb3174d25b429fa1faf5392b2669f354 (diff)
downloadyahns-cd84e2ccbdf29b908c7d4711528d61bac05505bb.tar.gz
Leaving running threads at exit seems to lead to occasional bugs at
finalization on Ruby 2.0.0.  This could be a bug with sleepy_penguin
or kgio, too, so I'll have to investigate further.  For now, we'll
just destroy the IOs associated with each queue and let the threads
die on their own.

This changes the QueueEgg internals a bit and I've removed the unit
test for QueueEgg now since the rest of the server already works
well (and QueueEgg internals may change even more).

Queues/worker threads no longer have their own logger, it seems like
excessive configurability/complexity since acceptors do not have
their own logger, either.  This logger only exists to log bugs in
yahns, not the application, so using the server logger is sufficient.
Diffstat (limited to 'lib/yahns/server_mp.rb')
-rw-r--r--lib/yahns/server_mp.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/yahns/server_mp.rb b/lib/yahns/server_mp.rb
index ab0559d..6e65bd4 100644
--- a/lib/yahns/server_mp.rb
+++ b/lib/yahns/server_mp.rb
@@ -164,6 +164,8 @@ module Yahns::ServerMP # :nodoc:
       Yahns::Log.exception(@logger, "main worker loop", e)
     end while alive || fdmap.size > 0
     exit
+  ensure
+    quit_finish
   end
 
   def mp_sig_handle(worker, alive)