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

From: cca5507 <cca5507(at)qq(dot)com>
To: Lucas DRAESCHER <git(at)draescher(dot)fr>, 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-03-20 03:17:07
Message-ID: tencent_FA41A8DD67685DE1576D508AAACC129EFA06@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Xuneng Zhou 2026-03-20 03:33:53 Re: BUG: Cascading standby fails to reconnect after falling back to archive recovery
Previous Message Chao Li 2026-03-20 03:12:33 Re: Trivial Fix: use palloc_array/repalloc_array for BufFile file arrays