~/talk

Bringing Linux pidfd to Ruby

Talkat RubyKaigi 2025 · 2025-04-16..04-18· [ruby, linux-and-operating-systems]
links:none on file
slides:none on file

Argues that Linux pidfd gives stable, race-free process references and fixes pid reuse and signal-race bugs; implements pidfd in Ruby via FFI calling the pidfd syscall family, wraps descriptors as IO, and uses them to send signals and reap children. Shows a reproduction where aggressive forking hits the same PID after 348 attempts. Deploys the pidfd-backed supervisor in production but notes limits: Linux 5.3+, same PID namespace only, no cross-container monitoring, and pidfd is an edge-case optimization rather than a default.

AI-written summary · about

  1. 0:00Introduction and speaker intro
  2. 1:23Ruby process management challenges
  3. 5:17Ruby threads vs processes in background jobs
  4. 8:56What are Linux pidfds
  5. 12:11Pid reuse race condition risks
  6. 13:56Signal race conditions in Ruby
  7. 16:05Process tree limitations in Ruby
  8. 18:16How Linux pidfds work
  9. 21:07Implementing pidfds in Ruby with FFI
  10. 22:53Using pidfds for process monitoring
  11. 24:37Pidfd limitations and constraints
  12. 25:58When to use pidfds in Ruby
  13. 27:03Future plans for pidfd in Ruby
  14. 28:31Q&A and closing remarks
~/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.