Re: Improve the granularity of PQsocketPoll's timeout parameter?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Improve the granularity of PQsocketPoll's timeout parameter?
Дата
Msg-id 1522504.1718221519@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Improve the granularity of PQsocketPoll's timeout parameter?  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Improve the granularity of PQsocketPoll's timeout parameter?
Список pgsql-hackers
I wrote:
> v3 attached uses pg_usec_time_t, and fixes one brown-paper-bag
> bug the cfbot noticed in v2.

Oh, I just remembered that there's a different bit of
pqConnectDBComplete that we could simplify now:

        if (timeout > 0)
        {
            /*
             * Rounding could cause connection to fail unexpectedly quickly;
             * to prevent possibly waiting hardly-at-all, insist on at least
             * two seconds.
             */
            if (timeout < 2)
                timeout = 2;
        }
        else                    /* negative means 0 */
            timeout = 0;

With this infrastructure, there's no longer any need to discriminate
against timeout == 1 second, so we might as well reduce this to

        if (timeout < 0)
            timeout = 0;

as it's done elsewhere.

            regards, tom lane



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Proposal for Updating CRC32C with AVX-512 Algorithm.
Следующее
От: Noah Misch
Дата:
Сообщение: Re: race condition in pg_class