Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c
Дата
Msg-id 20301.1034736099@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c  (Joe Conway <mail@joeconway.com>)
Ответы Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> [ some convincing test cases that timeout=1 is not good ]

>           remains.tv_sec = atoi(conn->connect_timeout);
> +         if (remains.tv_sec == 1)
> +             remains.tv_sec += 1;
>           if (!remains.tv_sec)
>           {
>               conn->status = CONNECTION_BAD;

On pure-paranoia grounds, I'd suggest the logic

+        /* force a sane minimum delay */
+         if (remains.tv_sec < 2)
+             remains.tv_sec = 2;

whereupon you could remove the failure check just below.
        regards, tom lane


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

Предыдущее
От: Greg Copeland
Дата:
Сообщение: Re: Vacuum improvement
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: droped out precise time calculations in src/interfaces/libpq/fe-connect.c