Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends? - Mailing list pgsql-hackers

From Srinath Reddy Sadipiralla
Subject Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends?
Date
Msg-id 18faa8875f4.49d046c87367.7389892592798553133@zohocorp.com
Whole thread Raw
Responses Re: Question: Why Are File Descriptors Not Closed and Accounted for PostgreSQL Backends?
List pgsql-hackers
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,lets say if we have multiple clients connected and
areactively running queries, won't the max number of open FDs (ulimit -n) limit of the system gets reached and cause
"Toomany open files issue"? 

Regards
Srinath Reddy




pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Re: Avoid possible dereference null pointer (src/backend/catalog/pg_depend.c)
Next
From: Yao Wang
Date:
Subject: Re: 回复: An implementation of multi-key sort