Re: connect_timeout parameter in libpq

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: connect_timeout parameter in libpq
Дата
Msg-id 21712.1029209717@sss.pgh.pa.us
обсуждение исходный текст
Ответ на connect_timeout parameter in libpq  (Denis A Ustimenko <denis@oldham.ru>)
Ответы Re: connect_timeout parameter in libpq  (Denis A Ustimenko <denis@oldham.ru>)
Re: connect_timeout parameter in libpq  (Denis A Ustimenko <denis@oldham.ru>)
Список pgsql-patches
Denis A Ustimenko <denis@oldham.ru> writes:
> I need to change current connectDBComplete() behavior ( hang if
> backend are not responding). Here is the patch. Please apply.

Shouldn't such a patch include documentation updates?  (And not
only user-level documentation; this patch adds not even a single
comment to explain what it's doing or why.)

I'm also not thrilled with the way that the patch imposes the
overhead of calculating the timeout whether the user wants it or not.
The time() kernel calls should be skipped unless needed.

A final comment is that the patch's timeout accuracy is quite poor, since
time()'s result is quantized to seconds.  gettimeofday() might be a
better choice.  Also it seems to assume that select() does not modify its
timeout argument, which is not a portable assumption.  On some platforms
the timeout struct is decremented by the elapsed time.

            regards, tom lane

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

Предыдущее
От: Denis A Ustimenko
Дата:
Сообщение: connect_timeout parameter in libpq
Следующее
От: Gavin Sherry
Дата:
Сообщение: Re: Fix disabled triggers with deferred constraints