Why are we using blocking libpq in the backend?

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Why are we using blocking libpq in the backend?
Дата
Msg-id 20230103203011.xieafwxbbxz3i6no@awork3.anarazel.de
обсуждение исходный текст
Список pgsql-hackers
Hi,

As noted in [1], and also commented on by other previously, we use libpq in
blocking mode in libpqwalreceiver, postgres_fdw, etc.  This is done knowingly,
see e.g. comments like:
    /*
     * Submit the query.  Since we don't use non-blocking mode, this could
     * theoretically block.  In practice, since we don't send very long query
     * strings, the risk seems negligible.
     */

but I don't understand why we do it. It seems like it'd be a fairly small
amount of additional code to just do it right, given that we do so for calls
to PQgetResult() etc?

Greetings,

Andres Freund

[1] https://postgr.es/m/20230103200520.di5hjebqvi72coql%40awork3.anarazel.de



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: New strategies for freezing, advancing relfrozenxid early
Следующее
От: Robert Haas
Дата:
Сообщение: Re: enable_timeout_every() and fin_time