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

From Richard Huxton
Subject Re: Sudden semi-deterministic disconnection between queries
Date
Msg-id 200403101349.16419.dev@archonet.com
Whole thread Raw
In response to Re: Sudden semi-deterministic disconnection between queries  (Peter Schuller <peter.schuller@infidyne.com>)
Responses Re: Sudden semi-deterministic disconnection between queries
List pgsql-general
On Wednesday 10 March 2004 12:24, Peter Schuller wrote:
> 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

(And log_statement according to your other post)

> 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.

Sounds like it to me.

> 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?

It's certainly highly suggestive of a problem on the client side.

> 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.

Don't use it myself, but there are examples in the source distribution that
seem to turn debugging on. Would the line below do anything for you:
  DriverManager.setLogStream(System.err);

--
  Richard Huxton
  Archonet Ltd

pgsql-general by date:

Previous
From: sferriol
Date:
Subject: bug in rule?
Next
From: Erwin Brandstetter
Date:
Subject: Hardware for a database server