You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed when performing many queries over TCP (ex: [:tcp, '8.8.8.8', 53]) that the ruby process would create a new TCP socket per-query. These TCP sockets would not be closed fast enough (ex; waiting in TIME_WAIT), and would eventually cause the process to hit it's maximum number of open file descriptors (ex: Errno::EADDRNOTAVAIL).
Steps To Reproduce
ruby test.rb
In another terminal run watch "netstat -n" to observe connections
I was looking through the code and it appears that UDP "sockets" are reused, where as the TCP "sockets" are used to create a new Transport for each request.
I noticed when performing many queries over TCP (ex:
[:tcp, '8.8.8.8', 53]
) that the ruby process would create a new TCP socket per-query. These TCP sockets would not be closed fast enough (ex; waiting inTIME_WAIT
), and would eventually cause the process to hit it's maximum number of open file descriptors (ex:Errno::EADDRNOTAVAIL
).Steps To Reproduce
ruby test.rb
watch "netstat -n"
to observe connectionsGemfile
test.rb
Note: if
:tcp
is changed to:udp
, then only one socket is created and reused.The text was updated successfully, but these errors were encountered: