Fwd: libpq: indefinite block on poll during network problems

From: Dmitry Samonenko <shreddingwork(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Fwd: libpq: indefinite block on poll during network problems
Date: 2014-05-27 12:36:08
Message-ID: CAFKp+3cV4LDXn5KUxDFQnewA6KYBO+7FgNa7n9eFGWE1iRGi6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, May 27, 2014 at 2:35 PM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>wrote:

> In PostgreSQL you can handle the problem of dying connections by setting
> the
> tcp_keepalives_* parameters (see
> http://www.postgresql.org/docs/current/static/runtime-config-connection.html
> ).
>
> That should take care of the problem, right?
>
> Yours,
> Laurenz Albe
>

I am afraid it won't help:

1. AFAIK, in Linux TCP keepalive is used on idle connections only. If not
all data is transmitted - connection is not idle - keep alive timer is not
started.
2. POLLHUP mask is used (while setting poll fds) to catch keep alive
timeout. Sadly, libpq sets (POLLIN | POLLERR).

With regards,
Dmitry Samonenko

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrej Vanek 2014-05-27 12:59:57 Re: hidden junk files in ...data/base/oid/
Previous Message Alban Hertroys 2014-05-27 11:25:19 Re: Delete trigger and data integrity