Re: Sudden semi-deterministic disconnection between queries

From: Richard Huxton <dev(at)archonet(dot)com>
To: Peter Schuller <peter(dot)schuller(at)infidyne(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Sudden semi-deterministic disconnection between queries
Date: 2004-03-10 13:49:16
Message-ID: 200403101349.16419.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Erwin Brandstetter 2004-03-10 13:51:57 Hardware for a database server
Previous Message sferriol 2004-03-10 13:15:10 bug in rule?