Mark van Cuijk <[email protected]> writes:
> Im developing an application using Postgres and when doing a transaction
> with a bunch of INSERT statements, the connection to the server (on
> localhost) often suddenly dies. Trying to diagnose the problem, Ive
> increased log levels and Ive run a tcpdump session to find out whats going
> on, can someone spot something strange or point me in a direction to continue
> debugging?
> The symptom I notice is that the Postgres server (9.1 from Ubuntu repo)
> closes the connection, sometimes by sending a TCP FIN, sometimes by sending a
> TCP RST, but Im not sure why this happens. The (node.js /
> node-postgres-pure) client doesnt report any error message that could have
> been received from the server; it only complains that the connection
> unexpectedly closed during query execution.
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.
regards, tom lane
--
Sent via pgsql-general mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general