Re: [Bug Report + Patch] File descriptor leak when io_method=io_uring - Mailing list pgsql-hackers

From cca5507
Subject Re: [Bug Report + Patch] File descriptor leak when io_method=io_uring
Date
Msg-id tencent_FA41A8DD67685DE1576D508AAACC129EFA06@qq.com
Whole thread Raw
In response to [Bug Report + Patch] File descriptor leak when io_method=io_uring  (Lucas DRAESCHER <git@draescher.fr>)
List 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

pgsql-hackers by date:

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