Re: Timeout and wait-forever in sync rep

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: Timeout and wait-forever in sync rep
Дата
Msg-id AANLkTim87K06KgPBcjDp6JyKXQNOvndwubCPqARS8Yhw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Timeout and wait-forever in sync rep  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-hackers
On Mon, Oct 18, 2010 at 10:24 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> I mean, for example, that the server cannot detect the disconnection for
> more than 60 seconds even if the user configures the keepalive as follows.
>
>    tcp_keepalives_idle      = 10
>    tcp_keepalives_interval  = 5
>    tcp_keepalives_count     = 2

Yeah, TCP is not going to detect a broken connection that quickly.

I think there's a fundamental impedence mismatch of between the
application needs here and the design goals of TCP.

TCP is designed to work if at all possible and only generate an error
if it's unavoidable. Keepalives were controversial when they were
proposed but for the original purpose -- ensuring that long-lived
servers didn't leak connections indefinitely -- they serve they work.
The point of them was to cover the remaining cases where there was no
data in flight and therefore no way to ever detect that the connection
was dead.

TCP is only going to detect a connection as dead if it has exceeded
all the engineering limits of the network. Until then it's still
possible it'll come back and having the network layer generate an
error when it's possible the connection is still functioning would be
bad.



--
greg


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: comments on type attributes broken in 9.1devel
Следующее
От: David Fetter
Дата:
Сообщение: Re: How to determine failed connection attempt due to invalid authorization (libpq)?