~/talk

The Less-Told Story of Socket Timeouts

Talkat RubyKaigi 2026 · 2026-04-22..04-24· [networking, ruby]
github:shioimm
slides:none on file

Ruby 4.0 adds open_timeout to Socket.tcp/TCPSocket.new so a single timeout covers name resolution through connection, solving cases where resolv_timeout and connect_timeout alone couldn’t bound total time under Fast Fallback (Happy Eyeballs v2). The implementation required switching name resolution to interruptible threads after abandoning getaddrinfo_a (which caused fork hangs), rejecting combinations of open_timeout with other timeouts, and enables Net::HTTP to drop the Timeout library.

AI-written summary · about

  1. 0:00Introduction to socket timeouts
  2. 1:59Ruby 2.0 and early timeouts
  3. 4:34Ruby 2.7 and name resolution timeout
  4. 6:55Ruby 3.0 and getaddrinfo_a issues
  5. 9:47Ruby 3.3 and interruptible resolution
  6. 11:19Happy Eyeballs version 2
  7. 18:20Ruby 4.0 and open_timeout
  8. 27:08Net::HTTP timeout resolution
  9. 28:15Conclusion and thanks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.