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

cca5507 <cca5507@qq.com>

From: cca5507 <cca5507@qq.com>
To: Lucas DRAESCHER <git@draescher.fr>, pgsql-hackers@lists.postgresql.org <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-20T03:17:07Z
Lists: pgsql-hackers
Hi,

Thanks for the report! I can reproduce this bug on master and your patch fixes it.

> I've attached a patch which registers an on_shmem_exit() callback
> to close the file descriptors on server exit. I took inspiration
> from how src/backend/storage/aio/method_worker.c handles cleanup.

I also verify that only the postmaster will call this callback because all children
of the postmaster will reset postmaster's callback.

My another thought is that add a shmem_cleanup callback to IoMethodOps and
do cleanup in this callback. Not sure which is better.

--
Regards,
ChangAo Chen

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix LATERAL references in GRAPH_TABLE with multi-label pattern