Re: Postgres connection failures - Mailing list pgsql-general

From Mark van Cuijk
Subject Re: Postgres connection failures
Date
Msg-id DC214042-D833-4FBB-ACDA-C141F1E0CFCD@45cents.nl
Whole thread Raw
In response to Re: Postgres connection failures  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On 04 Apr 2014, at 16:09 , Tom Lane <tgl@sss.pgh.pa.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
theconnection is closed. Printing a stack trace over there reveals that the pool code thinks the connection is idle and
closesit. I’ll submit a bug report in the node-postgres library. 

Thanks for the help!

/Mark

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Postgres connection failures
Next
From: Albe Laurenz
Date:
Subject: Re: Indices and Foreign Tables