summaryrefslogtreecommitdiff
path: root/lib/drb/unix.rb
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-25 02:32:15 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-25 02:32:15 +0000
commit7c31c2738c7d02e5a9ac6167c650cb8a5411321d (patch)
tree80f46a5c876e349aace12119135935ae622992d1 /lib/drb/unix.rb
parenta48022489f14f22aca34137e998bf7ffdd5c98c1 (diff)
drb: close graceful shutdown pipe before socket
Closing a listen socket while entering select(2) may trigger IOError or even deadlock because another thread may give the file descriptor to another file description; meaning the kernel can wait on the wrong description. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/drb/unix.rb')
-rw-r--r--lib/drb/unix.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/drb/unix.rb b/lib/drb/unix.rb
index adc38ff591..7dcf2daaf8 100644
--- a/lib/drb/unix.rb
+++ b/lib/drb/unix.rb
@@ -95,6 +95,7 @@ module DRb
public
def close
return unless @socket
+ shutdown # DRbProtocol#shutdown
path = @socket.path if @server_mode
@socket.close
File.unlink(path) if @server_mode