Rainbows! Rack HTTP server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] speed up QUIT for users of the unicorn worker_loop
@ 2015-10-15  1:37 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-10-15  1:37 UTC (permalink / raw)
  To: rainbows-public

WriterThreadPool, WriterThreadSpawn, Base, and potentially
other rarely-used concurrency options experienced slow shutdowns
due to the destruction of a listener socket failing to wake up
a thread in IO.select.

Send ourselves a signal to interrupt the IO.select call in
the main thread to force the wakeup.
 lib/rainbows.rb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/rainbows.rb b/lib/rainbows.rb
index 3bebf34..0af5620 100644
--- a/lib/rainbows.rb
+++ b/lib/rainbows.rb
@@ -93,6 +93,9 @@ module Rainbows
       tmp.each { |s| s.close rescue nil }.clear
       @at_quit.each { |task| task.call }
+      # XXX hack to break out of IO.select in worker_loop for some models
+      Process.kill(:QUIT, $$)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-15  1:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-15  1:37 [PATCH] speed up QUIT for users of the unicorn worker_loop Eric Wong

Rainbows! Rack HTTP server user/dev discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhbt.net/rainbows-public
	git clone --mirror http://ou63pmih66umazou.onion/rainbows-public

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 rainbows-public rainbows-public/ https://yhbt.net/rainbows-public \
		rainbows-public@yhbt.net rainbows-public@bogomips.org rainbows-talk@rubyforge.org rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
	public-inbox-index rainbows-public

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git