Re: Windows: Wrong error message at connection termination

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Windows: Wrong error message at connection termination
Дата
Msg-id 2120381.1638473504@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Windows: Wrong error message at connection termination  (Alexander Lakhin <exclusion@gmail.com>)
Ответы Re: Windows: Wrong error message at connection termination  (Sergey Shinderuk <s.shinderuk@postgrespro.ru>)
Список pgsql-hackers
Alexander Lakhin <exclusion@gmail.com> writes:
> 29.11.2021 22:16, Tom Lane wrote:
>> After re-reading that thread and re-studying relevant Windows
>> documentation [1][2], I think the main open question is whether
>> we need to issue shutdown() or not, and if so, whether to use
>> SD_BOTH or just SD_SEND.  I'm inclined to prefer not calling
>> shutdown(), because [1] is self-contradictory as to whether it
>> can block, and [2] is pretty explicit that it's not necessary.

> I've tested the close-only patch with pg_sleep() in pqReadData(), and it
> works too.

Thanks for testing!

> So I wonder how to understand "To assure that all data is
> sent and received on a connected socket before it is closed, an
> application should use shutdown to close connection before calling
> closesocket." in [1].

I suppose their documentation has evolved over time.  This sentence
probably predates their explicit acknowledgement in [2] that you don't
have to call shutdown().  Maybe, once upon a time with very old
versions of Winsock, you did have to do so if you wanted graceful close.

I'll push the close-only change in a little bit.

            regards, tom lane



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Column Filtering in Logical Replication
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: PATCH: generate fractional cheapest paths in generate_orderedappend_path