Re: Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends?
| От | Heikki Linnakangas |
|---|---|
| Тема | Re: Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends? |
| Дата | |
| Msg-id | e340b428-764c-4b44-baea-653769fa454d@iki.fi обсуждение исходный текст |
| Ответ на | Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends? (Srinath Reddy Sadipiralla <srinath.reddy@zohocorp.com>) |
| Ответы |
Re: Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends?
|
| Список | pgsql-hackers |
On 24/05/2024 15:17, Srinath Reddy Sadipiralla wrote:
> Hi PostgreSQL Community,
> when a backend process starts, pq_init is called where it opens a FD during CreateWaitEventSet()
>
>
> if (!AcquireExternalFD())
> {
> /* treat this as though epoll_create1 itself returned EMFILE */
> elog(ERROR, "epoll_create1 failed: %m");
> }
> set->epoll_fd = epoll_create1(EPOLL_CLOEXEC);
>
>
> but we didn't closed or called ReleaseExternalFD() for accounting
Yes we do, see FreeWaitEventSet().
The WaitEventSet created fro pq_init() is never explicitly free'd
though, because it's created in the per-connection backend process. When
the connection is terminated, the backend process exits, cleaning up any
resources including the WaitEventSet.
--
Heikki Linnakangas
Neon (https://neon.tech)
В списке pgsql-hackers по дате отправления: