Re: ssl tests aren't concurrency safe due to get_free_port()

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: ssl tests aren't concurrency safe due to get_free_port()
Дата
Msg-id 0867ca05-ed3f-09ca-cd41-d7087e542362@dunslane.net
обсуждение исходный текст
Ответ на Re: ssl tests aren't concurrency safe due to get_free_port()  (Andres Freund <andres@anarazel.de>)
Ответы Re: ssl tests aren't concurrency safe due to get_free_port()  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
On 2022-11-05 Sa 14:36, Andres Freund wrote:
>>  
>>  use Carp;
>>  use Config;
>> -use Fcntl qw(:mode);
>> +use Fcntl qw(:mode :flock :seek O_CREAT O_RDWR);
> Does this do anything useful on windows?


All we're doing here on Windows and elsewhere is getting access to some
constants used in calls to flock(), seek() and sysopen(). It's not
actually doing anything else anywhere.


>
>> +    if ($pid +0 > 0)
> Gotta love perl.


Think of it as a typecast.


>
>
>> +    {
>> +        if (kill 0, $pid)
> Does this work on windows?
>
Yes, it's supposed to. It doesn't actually send a signal, it checks if
the process exists. There's some suggestion it might give false
positives on Windows, but that won't really hurt us here, we'll just
look for a different port.

One possible addition would be to add removing the reservation files in
an END handler. That would be pretty simple.


cheers


andrew


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




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

Предыдущее
От: Nikolay Shaplov
Дата:
Сообщение: Re: [PATCH] New [relation] option engine
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17434: CREATE/DROP DATABASE can be executed in the same transaction with other commands