Re: pgsql: Add kqueue(2) support to the WaitEventSet API. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pgsql: Add kqueue(2) support to the WaitEventSet API.
Date
Msg-id 20263.1582228617@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Add kqueue(2) support to the WaitEventSet API.  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgsql: Add kqueue(2) support to the WaitEventSet API.
List pgsql-hackers
I wrote:
> It seems fairly obvious now that I look at it, but: the epoll and kqueue
> variants of CreateWaitEventSet are both *fundamentally* unsafe, because
> they assume that they can always get a FD when they want one, which is
> not a property that we generally want backend code to have.  The only
> reason we've not seen this before with epoll is a lack of testing
> under lots-of-FDs stress.
> The fact that they'll likely leak those FDs on subsequent failures is
> another not-very-nice property.

Hmmm ... actually, there's a third problem, which is the implicit
assumption that we can have as many concurrently-active WaitEventSets
as we like.  We can't, if they depend on FDs --- that's a precious
resource.  It doesn't look like we actually ever have more than about
two per process right now, but I'm concerned about what will happen
as the usage of the feature increases.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Add kqueue(2) support to the WaitEventSet API.
Next
From: Tom Lane
Date:
Subject: Re: Add PGURI env var for passing connection string to psql in Docker