From: Barry Lind <blind@xythos.com>
To: Phil.Hourihane@meridianp2p.com
Cc: pgsql-jdbc@postgresql.org
Subject: Re: java.net.SocketException: Broken pipe
Date: Mon, 22 Sep 2003 08:46:44 -0700
Message-ID: <3F6F1964.50004@xythos.com> (raw)
In-Reply-To: <OF6400F565.F10706C8-ON80256DA9.0045C24A-80256DA9.0045D215@meridianp2p.com>
References: <OF6400F565.F10706C8-ON80256DA9.0045C24A-80256DA9.0045D215@meridianp2p.com>
Phil,
A possible cause is a firewall or some other device between the client
and the server that drops connections after a certain time. (Most
firewall don't allow you to keep connections open indefinitely).
thanks,
--Barry
Phil.Hourihane@meridianp2p.com wrote:
> Hello, World.
>
> I have an intermittent problem that I am having trouble with, using
> postgresql
> 7.3.4. It manifests itself as a SocketException...
>
> java.net.SocketException: Broken pipe
> at java.net.SocketOutputStream.socketWrite0(Native Method)
> at
> java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
> at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
> at
> java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:69)
> at
> java.io.BufferedOutputStream.flush(BufferedOutputStream.java:127)
> at org.postgresql.PG_Stream.flush(PG_Stream.java:352)
> at
> org.postgresql.core.QueryExecutor.sendQuery(QueryExecutor.java:159)
> at
> org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:70)
> ...etc...
>
> ... but it doesn't seem to correspond to the mails on this list that
> mention
> this trace. The previous mails warn that this can happen if an earlier
> statement
> includes a null character (char 0). I tried to reproduce the problem that
> way but instead I was prevented by...
>
> java.lang.IllegalArgumentException: \0 not allowed
> at
> org.postgresql.jdbc1.AbstractJdbc1Statement.escapeString(AbstractJdbc1Statement.java:955)
> at
> org.postgresql.jdbc1.AbstractJdbc1Statement.setString(AbstractJdbc1Statement.java:917)
> at
> org.postgresql.jdbc1.AbstractJdbc1Statement.setString(AbstractJdbc1Statement.java:900)
> ...etc...
>
> Now, the problem seems to occur only intermittently, and will 'repair'
> itself
> with no action on my part. It does however, seem to occur in clumps - it
> will
> fail a few times in a short space of time before working again.
>
> I have created a statement at boot time for this purpose (it is a
> statement
> that gets used a lot, so I prefer to cache it), rather than create a new
> statement for each invocation. Some posts on the mailing list mention this
> as a problem (the backend shutting down the connection), but I have no
> idea
> how to control this behaviour.
>
> I don't seen to be able to reproduce this behaviour on demand; I have seen
> it in logs of a system that is running long-term, not just a development
> box
> that is working for a little bit at a time.
>
> It doesn't seem to be related to heavy loads on the system either - the
> load
> has been pretty light when it occurred.
>
> Has anybody else encountered this problem or had any success in dealing
> with it?
>
> PHiL
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: blind@xythos.com, Phil.Hourihane@meridianp2p.com
Subject: Re: java.net.SocketException: Broken pipe
In-Reply-To: <3F6F1964.50004@xythos.com>
References: <OF6400F565.F10706C8-ON80256DA9.0045C24A-80256DA9.0045D215@meridianp2p.com> <3F6F1964.50004@xythos.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox