Re: Postgres connection failures

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: Postgres connection failures
Дата
Msg-id
5832.1396620552@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
Postgres connection failures Mark van Cuijk <postgresql.org-pgsql-general-41@45cents.nl>
Re: Postgres connection failures Tom Lane <tgl@sss.pgh.pa.us>
Re: Postgres connection failures Mark van Cuijk <postgresql.org-pgsql-general-41@45cents.nl>
Mark van Cuijk  writes:
> I�m 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, I�ve increased log levels and I�ve run a tcpdump session to find out what�s 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 I�m not sure why this happens. The (node.js / node-postgres-pure) client doesn�t 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

В списке pgsql-general по дате отправления
От: Mark van Cuijk
Дата:
Сообщение: Postgres connection failures
От: Mark van Cuijk
Дата:
FAQ