Bug #11600
closedindeterministic failures on socket operations when running out of file descriptors
Description
We've been getting indeterministic failures on socket operations when running out of file descriptors, instead of the correct Errno::EMFILE
being raised we've seen various failure modes, on both linux and osx:
- This is what we're seeing in production the most, masquerading as a dns failure
ruby test.rb
1017 tempfiles
freeing 4
test.rb:24:in getaddrinfo': getaddrinfo: Name or service not known (SocketError) from test.rb:24:in
block (3 levels) in '
ruby test.rb
1017 tempfiles
freeing 4
test.rb:24: [BUG] † - errno == 0
ruby 2.2.4p180 (2015-10-06 revision 52046) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0009 e:000008 CFUNC :getaddrinfo
c:0002 p:0018 s:0004 e:000003 BLOCK test.rb:24 [FINISH]
c:0001 p:---- s:0002 e:000001 TOP [FINISH]
-- Ruby level backtrace information ----------------------------------------
test.rb:24:in block (3 levels) in <main>' test.rb:24:in
getaddrinfo'
ruby test.rb
1017 tempfiles
freeing 4
test.rb:24: [BUG] rb_sys_fail(getaddrinfo) - errno == 0
ruby 2.2.4p180 (2015-10-06 revision 52046) [x86_64-linux]
-- Control frame information -----------------------------------------------
c:0003 p:---- s:0009 e:000008 CFUNC :getaddrinfo
c:0002 p:0018 s:0004 e:000003 BLOCK test.rb:24 [FINISH]
c:0001 p:---- s:0002 e:000001 TOP [FINISH]
-- Ruby level backtrace information ----------------------------------------
test.rb:24:in block (3 levels) in <main>' test.rb:24:in
getaddrinfo'
Similar errors also happen doing other operations (eg TCPSocket.open
)
Test case attached
Files