about summary refs log tree commit homepage
path: root/lib/yahns/queue_epoll.rb
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-05-08 02:42:54 +0000
committerEric Wong <e@80x24.org>2015-05-08 02:44:33 +0000
commita25a203038bba9769ada5afd478d6250a44f543b (patch)
tree36f352ffbc6a878a71ac837088a5d793220055d1 /lib/yahns/queue_epoll.rb
parent9e3217b0522315d2d115e53309f3563e9554ffc9 (diff)
downloadyahns-a25a203038bba9769ada5afd478d6250a44f543b.tar.gz
Reactivating a client socket after the proxied response is
complete requires the object remain visible to the Ruby GC while
no thread is accessing it.  So we must place the object back
into the fdmap to prevent the GC from eating it (and having
epoll return an invalid pointer).
Diffstat (limited to 'lib/yahns/queue_epoll.rb')
-rw-r--r--lib/yahns/queue_epoll.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yahns/queue_epoll.rb b/lib/yahns/queue_epoll.rb
index 10ff607..4f3289e 100644
--- a/lib/yahns/queue_epoll.rb
+++ b/lib/yahns/queue_epoll.rb
@@ -58,7 +58,7 @@ class Yahns::Queue < SleepyPenguin::Epoll::IO # :nodoc:
             # expected to work, so we had to erase it from fdmap before hijack
           when nil, :close
             # this must be the ONLY place where we call IO#close on
-            # things that got inside the queue
+            # things that got inside the queue AND fdmap
             @fdmap.sync_close(io)
           else
             raise "BUG: #{io.inspect}#yahns_step returned: #{rv.inspect}"