Re: [Bug Report + Patch] File descriptor leak when io_method=io_uring

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: Lucas DRAESCHER <git(at)draescher(dot)fr>
Cc: Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Laetitia Avrot <laetitia(dot)avrot(at)gmail(dot)com>, "tanswis42(at)gmail(dot)com" <tanswis42(at)gmail(dot)com>, cca5507 <cca5507(at)qq(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Bug Report + Patch] File descriptor leak when io_method=io_uring
Date: 2026-11-03 11:31:30
Message-ID: CAKZiRmyrauX8KyeBy+h1B=GgQE68fpQ4H9sXgws_N-EaGZ5+ug@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Sep 9, 2026 at 8:10 PM Lucas DRAESCHER <git(at)draescher(dot)fr> wrote:
[..]
> v4 addresses all these items. I have moved the CF entry to "Needs review".

Hi Lucas,

patch LGTM:
- the tests pass: PG_TEST_INITDB_EXTRA_OPTS="-c io_method=io_uring"
meson test -C build
- issue is not reproducible with the patch
- code looks good

As for backpatching, dunno: on one hand I was suspecting more people would be
affected so far, but it seems to be rare? (judging from EDB's tickets and
not many people in this thread). So for me, fixing this only in master
would be good enough (or maybe not that many people are using PG18+io_uring
and getting SIGSEGvs). Anyway, just some nano findings:

a. elog(DEBUG1, "cleaning up %d io_uring processes", TotalProcs)
we are not cleaning "io_uring processes", but "io_uring instances"

b. Commit message could stress more that that it prevents io_uring fd leaks
on restarts, that sooner or later may cause failure to self-heal sooner
or later with symptomps like one of the following:
FATAL: could not setup io_uring queue: Too many open files
FATAL: could not setup io_uring queue: Cannot allocate memory

Perhaps, just ammend a little, drop v5 here and set to Ready for Commiter
and let's see what happens.

-J.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Narayanan Venkateswaran 2026-11-03 12:07:55 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Jonathan Gonzalez V. 2026-11-03 11:17:40 Re: Avoid duplicate file references in backend .pot file