~/talk

Making TCPSocket.new "Happy"!

Talkat RubyKaigi 2025 · 2025-04-16..04-18· [ruby, networking]
github:shioimm
slides:none on file

Adds Happy Eyeballs v2 to TCPsocket.new implemented in C, reimplementing parallel name resolution per address family with detached threads, pipes and a single select loop; uses resolution delay 50ms and connection attempt 250ms timing and cancels other connects on success. Fixes: immediate retry when all prior connects fail (avoids spurious connection timeout), replaces raw select with RBThreadFDSelect to avoid FD_SET limits (prevents segfault), and lands in Ruby 3.4 with a slight benchmark overhead but up to 132× speedup in worst-case DNS stalls.

AI-written summary · about

  1. 0:00Introduction
  2. 1:20Happy Eyeballs v2 overview
  3. 6:51Improving Socket.tcp
  4. 13:40TCPSocket.new implementation
  5. 21:40Fixing connection timeout bug
  6. 24:01Handling large file descriptors
  7. 26:41Enabling Happy Eyeballs by default
  8. 27:41Performance impact and results
  9. 29:10Conclusion and thanks
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.