Project

General

Profile

Actions

Bug #17664

open

Behavior of sockets changed in Ruby 3.0 to non-blocking

Added by ciconia (Sharon Rosner) over 1 year ago. Updated 12 months ago.

Status:
Assigned
Priority:
Normal
Target version:
-
[ruby-core:102652]

Description

I'm not sure this is a bug, but apparently a change was introduced in Ruby 3.0 that makes sockets non-blocking by default. This change was apparently introduced as part of the work on the FiberScheduler interface. This change of behaviour is not discussed in the Ruby 3.0.0 release notes.

This change complicates the implementation of an io_uring-based fiber scheduler, since io_uring SQE's on fd's with O_NONBLOCK can return EAGAIN just like normal syscalls. Using io_uring with non-blocking fd's defeats the whole purpose of using io_uring in the first place.

A workaround I have put in place in the Polyphony io_uring backend is to make sure O_NONBLOCK is not set before attempting I/O operations on any fd.

Actions

Also available in: Atom PDF