Re: Mixed up protocol packets in server response?

From: Michal Politowski <mpol+pg(at)meep(dot)pl>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Mixed up protocol packets in server response?
Date: 2011-06-03 13:03:57
Message-ID: 20110603130357.GA7961@meep.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

On Thu, 2 Jun 2011 08:50:30 +0800, Craig Ringer wrote:
> On 1/06/2011 9:06 PM, Michal Politowski wrote:
>
> >What may be the cause of this weird problem? Is it some known or unknown bug in
> >8.3.4 or is the application/Java side more suspected?
>
> It'd be really helpful if you could collect and examine a trace of
> the client/server communication using WireShark. That way you can
> confirm whether it is (as Tom suspects) the client side mangling its
> buffers, or whether the server really did send the nonsensical
> sequence.

Actually my own money is with Tom's. It's very hard to believe Postgres
would do something like this, unless it were some obvious and long fixed bug in 8.3.4.

Still, trying to trace the communication makes sense, if I can convince the
owners of the system to let me do it. Unfortunately this is an
"one in a million of successful queries" (actually two in much more than a million)
problem. And the next run of the application seems not to have hit it, yet.

Thinking aloud: If this is, as it is to be suspected, an application-side problem,
there is at first sight not much space in the application where it could hide. The data is
mixed up in a driver buffer, two method calls from the standard library
socket code. There is the VisibleBufferedInputStream there. Could it do
something like this? Maybe if the connection was erroneously used from two threads
concurrently? The connections are pooled via commons-dbcp BasicDataSource
and queries are executed via Spring JdbcTemplate within Spring-configured
transaction. No passing connections by hand anywhere, everything should be
nicely thread-bound. Still, if not here, where could it go wrong?

--
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc Mamin 2011-06-03 13:04:50 Re: Question about configuration and SSD
Previous Message Rob Richardson 2011-06-03 12:52:15 PostgreSQL service won't start after bad computer time

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2011-06-03 13:53:59 Re: Mixed up protocol packets in server response?
Previous Message Craig Ringer 2011-06-02 00:50:30 Re: Mixed up protocol packets in server response?