Re: Sudden semi-deterministic disconnection between queries - Mailing list pgsql-general

From Peter Schuller
Subject Re: Sudden semi-deterministic disconnection between queries
Date
Msg-id 200403101324.59548.peter.schuller@infidyne.com
Whole thread Raw
In response to Re: Sudden semi-deterministic disconnection between queries  (Richard Huxton <dev@archonet.com>)
Responses Re: Sudden semi-deterministic disconnection between queries
Re: Sudden semi-deterministic disconnection between queries
Re: Sudden semi-deterministic disconnection between queries
List pgsql-general
Hello,

> Assuming you're logging anything, start with LOG_STATEMENT and perhaps
> follow up with SERVER_MIN_MESSAGES. Note that you can do this with SQL
>   SET LOG_STATEMENT=on;
>
> There are details on log settings in the runtime configuration section of
> the manuals. You can log huge amounts of info if you like.

[and from your other message: ]

>So - it's complaining the connection is closed! If it's the backend crashing,
>that must be listed in the logs.

I didn't find anything about SERVER_MIN_MESSAGES, but I did add the following
to my configuration:

log_min_messages = debug5
log_min_error_statement = debug5
log_connections = true

I get a lot of information logged as expected, but I still see nothing at all
about closed connections or crashed backend processes.

I'm wondering if it's the JDBC driver that thinks it's disconnected for some
bogus reason.

It is worth noting then when I kill off the client I *do* get this in the log:

Mar 10 13:12:50 defiant postgres[5427]: [350-1] LOG:  unexpected EOF on client
connection

I just tried restarting the application and giving it some traffic causing it
to open two connections to the database. I saw processes for these
connections by doing ps aux | grep post. When I triggered the 'not connected'
problem there was indeed one server process missing, but the other one had
survived and I did get the above message about unexpected EOF for the
remaining connection when I killed off the client again.

The question is - under circumstances such as these, with the above logging
turned on and postgresql being fully alive and well (since other connections
still work and postgresql never needs to be started), is postgresql
guaranteed to put something in the log in the event of an *unexpected*
shutdown of one of the postmasters?

If the answer to that question is yes, would not this be indicative that the
problem is indeed on the client side becaue the client is apparantly closing
the connection cleanly?

Is anyone aware of a way to make the JDBC driver do some kind of verbose
logging? I have pretty much exhausted the list of possible problems with my
code and it would be interesting to see whether the JDBC driver is actively
closing the connection for some reason, or if it is receiving some form of
terminating sequence from the server.

(I have looked at the on-the-wire postgresql protocol before but it's been a
while now so I'm not sure if the latter is a possibility.)

--
/ Peter Schuller, InfiDyne Technologies HB

PGP userID: 0xE9758B7D or 'Peter Schuller <peter.schuller@infidyne.com>'
Key retrieval: Send an E-Mail to getpgpkey@scode.org
E-Mail: peter.schuller@infidyne.com Web: http://www.scode.org


pgsql-general by date:

Previous
From: "Mattias Kregert"
Date:
Subject: Re: Error message
Next
From: Peter Schuller
Date:
Subject: Re: Sudden semi-deterministic disconnection between queries