Project

General

Profile

Actions

Bug #11600

closed

indeterministic failures on socket operations when running out of file descriptors

Added by erkkie (Erkki Eilonen) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.2.4p180 (2015-10-06 revision 52046) [x86_64-linux]
[ruby-core:71100]

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:

  1. 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

test.rb (483 Bytes) test.rb ruby test.rb erkkie (Erkki Eilonen), 10/18/2015 10:22 AM
testcase.rb (431 Bytes) testcase.rb tarmo_t (Tarmo Tänav), 10/18/2015 12:35 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0