Re: BUG #17828: postgres_fdw leaks file descriptors on error and aborts aborted transaction in lack of fds - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17828: postgres_fdw leaks file descriptors on error and aborts aborted transaction in lack of fds
Date
Msg-id 423731.1678381075@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17828: postgres_fdw leaks file descriptors on error and aborts aborted transaction in lack of fds  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #17828: postgres_fdw leaks file descriptors on error and aborts aborted transaction in lack of fds  (Alexander Lakhin <exclusion@gmail.com>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.org> writes:
> The following script:
> [ leaks a file descriptor per error ]

Yeah, at least on platforms where WaitEventSets own kernel file
descriptors.  I don't think it's postgres_fdw's fault though,
but that of ExecAppendAsyncEventWait, which is ignoring the
possibility of failing partway through.  It looks like it'd be
sufficient to add a PG_CATCH or PG_FINALLY block there to make
sure the WaitEventSet is disposed of properly --- fortunately,
it doesn't need to have any longer lifespan than that one
function.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17826: An assert failed in /src/backend/optimizer/util/var.c
Next
From: Hanna Yanchurevich
Date:
Subject: Re: BUG #17827: Rule on insert into table doesn't work when excepting select from the table itself