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