Re: MSVC SSL test failure

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: MSVC SSL test failure
Дата
Msg-id ba1b78e6-3777-58ae-4981-110bcf71e985@dunslane.net
обсуждение исходный текст
Ответ на Re: MSVC SSL test failure  (Alexander Lakhin <exclusion@gmail.com>)
Ответы Re: MSVC SSL test failure  (Alexander Lakhin <exclusion@gmail.com>)
Список pgsql-hackers
On 12/6/21 10:30, Alexander Lakhin wrote:
> Hello Andrew,
> 06.12.2021 17:56, Andrew Dunstan wrote:
>> Yeah, quite annoying, especially because only some combinations of MSVC
>> runtime / openssl version seem to trigger the problem.
>>
>>
>> Adding a shutdown() before the closesocket() also fixes the issue.
>>
> Can you confirm that adding shutdown(MyProcPort->sock, SD_BOTH) fixes
> the issue for many test runs?
> I don't see the stable test passing here.
> Without shutdown() the test failed on iterations 1, 5, 4, but with
> shutdown() it failed too, on iterations 3, 1, 4.
> Without close() and shutdown() the test passes 20 iterations.
> (I'm still researching how openssl affects the shutdown sequence.)




I have been getting 100% failures on the SSL tests with closesocket()
alone, and 100% success over 10 tests with this:


diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index 96ab37c7d0..5998c089b0 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -295,6 +295,7 @@ socket_close(int code, Datum arg)
         * Windows too.  But it's a lot more fragile than the other way.
         */
 #ifdef WIN32
+       shutdown(MyProcPort->sock, SD_SEND);
        closesocket(MyProcPort->sock);
 #endif


That said, your results are quite worrying.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




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

Предыдущее
От: Jacob Champion
Дата:
Сообщение: Re: Transparent column encryption
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ExecTypeSetColNames is fundamentally broken