Re: Postgres connection failures

From: Mark van Cuijk <postgresql(dot)org-pgsql-general-41(at)45cents(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres connection failures
Date: 2014-04-04 14:47:33
Message-ID: DC214042-D833-4FBB-ACDA-C141F1E0CFCD@45cents.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04 Apr 2014, at 16:09 , Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Your log extract looks like the server side thought it got a connection
> closure command. In particular, the server process seems to have exited
> normally, and it did not write "LOG: unexpected EOF on client connection",
> which it would have done if the TCP connection dropped without receipt of
> such a command.
>
> Based on these facts, I'm going to speculate that your client application
> is multi-threaded and some thread is closing a connection out from under
> another one. It's usually best to have only one thread touching a
> particular connection; or if you want to maintain a connection pool
> yourself, be very sure you have clear acquire and release rules.

Thanks! I’ve patched the library to print all outgoing messages and indeed it seems one with 0x58 is sent just before the connection is closed. Printing a stack trace over there reveals that the pool code thinks the connection is idle and closes it. I’ll submit a bug report in the node-postgres library.

Thanks for the help!

/Mark

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Albe Laurenz 2014-04-04 15:01:44 Re: Indices and Foreign Tables
Previous Message Emmanuel Medernach 2014-04-04 14:40:42 UDF calls and FDW