Project

General

Profile

Actions

Bug #20587

open

dir.c calls blocking filesystem APIs/system calls while holding the GVL

Added by ivoanjo (Ivo Anjo) 8 days ago. Updated 8 days ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:118347]

Description

Hey! I work for Datadog on the Ruby profiler part of the datadog (previously ddtrace) gem.

While I was investigating https://bugs.ruby-lang.org/issues/20586, I spotted that there's a number of cases where, in dir.c, blocking system calls are being made (e.g. readdir(), opendir(), etc) without releasing the GVL.

This means that if they block for a long time (as happens in the gcsfuse example in https://bugs.ruby-lang.org/issues/20586 ), the Ruby VM will just be blocked and not make any progress.

The combination of not releasing the GVL + slow system calls actually makes the issue in https://bugs.ruby-lang.org/issues/20586 more likely to happen with the Datadog profiler, although even if the code releases the GVL the underlying issue could still happen, and this is why I decided to file this bug separately.

Actions #1

Updated by ivoanjo (Ivo Anjo) 8 days ago

  • Subject changed from dir.c calls blocking system calls while holding the GVL to dir.c calls blocking filesystem APIs/system calls while holding the GVL
Actions

Also available in: Atom PDF

Like0
Like0