Re: pgsql: Add kqueue(2) support to the WaitEventSet API.

Поиск
Список
Период
Сортировка
От Mark Dilger
Тема Re: pgsql: Add kqueue(2) support to the WaitEventSet API.
Дата
Msg-id 13F92C31-0E60-45C9-9031-3B1ECFDD5261@enterprisedb.com
обсуждение исходный текст
Ответ на Re: pgsql: Add kqueue(2) support to the WaitEventSet API.  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgsql: Add kqueue(2) support to the WaitEventSet API.  (Andres Freund <andres@anarazel.de>)
Re: pgsql: Add kqueue(2) support to the WaitEventSet API.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

> On Feb 20, 2020, at 8:30 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> This idea doesn't fix every possible problem.  For instance, if you
> have a plperlu function that wants to open a bunch of files, I don't
> see any easy way to ensure we release VFDs to make that possible.
> But it's sure an improvement on the status quo.

I understand that you were using plperlu just as an example, but it got me thinking.  Could we ship a wrapper using
perl'stie() mechanism to call a new spi function to report when a file handle is opened and when it is closed?  Most
plperlufunctions would not participate, since developers will not necessarily know to use the wrapper, but at least
theycould learn about the wrapper and use it as a work-around if this becomes a problem for them.  Perhaps the same spi
functioncould be used by other procedural languages. 

I can't see this solution working unless the backend can cleanup properly under exceptional conditions, and decrement
thecounter of used file handles appropriately.  But that's the same requirement that postgres_fdw would also have,
right? Would the same mechanism work for both? 

I imagine something like <PgPerluSafe>::IO::File and <PgPerluSafe>::File::Temp which could be thin wrappers around
IO::Fileand File::Temp that automatically do the tie()ing for you. (Replace <PgPerluSafe> with whichever name seems
best.)

Is this too convoluted to be worth the bother?

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company






В списке pgsql-hackers по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: plan cache overhead on plpgsql expression
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pgsql: Add kqueue(2) support to the WaitEventSet API.