Re: BUG #17828: postgres_fdw leaks file descriptors on error and aborts aborted transaction in lack of fds

From: Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17828: postgres_fdw leaks file descriptors on error and aborts aborted transaction in lack of fds
Date: 2024-02-09 10:46:03
Message-ID: CAPmGK15f1P6pn5pSxsTspvm4RhHNTeecAXNOa+N0hH7jrHYdjw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Fri, Feb 9, 2024 at 11:08 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> ISTM we do need to do something about this AcquireExternalFD failure
> though, because that's just self-inflicted damage. (And I think it's
> likely new since we invented WaitEventSets, though perhaps I'm wrong
> about that.)

+1; but my concern is that even if we fix that failure, it is still
possible that WaitLatchOrSocket in pgfdw_get_cleanup_result throws an
error, causing the same error-during-error-recovery loop. (For
example, epoll_create1() can fail in CreateWaitEventSet in the
WaitLatchOrSocket after reserving an external FD, leading to an
error.)

Best regards,
Etsuro Fujita

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2024-02-11 21:30:28 Re: BUG #18334: Segfault when running a query with parallel workers
Previous Message Tom Lane 2024-02-09 02:08:46 Re: BUG #17828: postgres_fdw leaks file descriptors on error and aborts aborted transaction in lack of fds