Ruby and interrupted system calls (EINTR)

Hello there!

I'm currently researching how "safe" the Ruby ecosystem (apps, gems, VM)
are regarding sending signals to the Ruby VM which can cause system calls
to be interrupted and return EINTR.

A few years ago in Python there was an effort to make sure the default
wrappers provided by Python did the "right thing" automatically when a
system call returns EINTR: PEP 475 -- Retry system calls failing with EINTR | Python.org .

I've been looking at the Ruby sources and there are quite a few places
where EINTR is handled, but not a lot of documentation around if the VM is
usually expected to handle this in all cases OR if it's a case-by-case
thing and user libraries need to be modified to catch all the EINTRs that
Ruby doesn't handle.

I thought I'd try my luck and try posting to this list and ask if anyone
had some hints on this matter of EINTR handling :slight_smile:

Thanks, and have an awesome day, y'all.
-- Ivo Anjo