pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedInifinite socket send from backend to java servlet
3+ messages / 3 participants
[nested] [flat]
* Inifinite socket send from backend to java servlet
@ 1999-11-03 04:58 Rich Ryan <postgres@weblynk.com>
1999-11-03 06:09 ` Re: [INTERFACES] Inifinite socket send from backend to java servlet Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Rich Ryan @ 1999-11-03 04:58 UTC (permalink / raw)
To: pgsql-interfaces
I'm running RH Linux 5.2, Jdk 1.1.7v3 on machine A, and RH Linux 6.1,
postgres 6.5.2 on machine B. Some queries made from A to B never return. It
looks like the java servlet on machine A skipped out on the query or the
thread died or got interrupted or something, and machine B is infinitely
waiting for it to read query results. Doing a ps -x will show several
postmaster processes doing SELECT's, but just sitting there, ( not SELECT
waiting), but not consuming any cpu time either. When I restart the web
server on machine A and then immediately look at the postgres log file on
machine B, I get a ton of these messages...
FATAL: pq_endmessage failed: errno=32
pq_flush: send() failed: Broken pipe
Within a half day or so, my database connection pool is exhausted because
there taken up by these infinite waits. Of course, I could write a db
connection timeout thread that closes these lazy connections, and I suspect
that the postmaster processes on machine B would detect the broken
connection and go away also, but still... seems like pretty icky behavior.
Any comments?
Rich
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: [INTERFACES] Inifinite socket send from backend to java servlet
1999-11-03 04:58 Inifinite socket send from backend to java servlet Rich Ryan <postgres@weblynk.com>
@ 1999-11-03 06:09 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 1999-11-03 06:09 UTC (permalink / raw)
To: Rich Ryan <postgres@weblynk.com>; +Cc: pgsql-interfaces
Rich Ryan <postgres@weblynk.com> writes:
> I'm running RH Linux 5.2, Jdk 1.1.7v3 on machine A, and RH Linux 6.1,
> postgres 6.5.2 on machine B. Some queries made from A to B never return. It
> looks like the java servlet on machine A skipped out on the query or the
> thread died or got interrupted or something, and machine B is infinitely
> waiting for it to read query results.
I'm not qualified to comment on (nor interested in) the problem with the
java servlets, but I'd say they are pretty buggy if they're dying in the
middle of reading query results.
However, the backend ought to recover gracefully from client failure,
and if it's not then I'm interested in that.
> I get a ton of these messages...
> FATAL: pq_endmessage failed: errno=32
> pq_flush: send() failed: Broken pipe
> Within a half day or so, my database connection pool is exhausted because
> there taken up by these infinite waits.
What is supposed to happen is that you get a few of these messages in
the log while the backend tries to dump out the query results to the
no-longer-connected client (maybe more than a few of them, if it was a
big query :-(), and then when the backend finishes the query and tries
to read the next command from the client, it notices that the client
connection isn't there anymore, and gracefully exits. Apparently you've
found a combination of circumstances where this doesn't happen like it's
supposed to. I have no immediate ideas about why. Can anyone else
reproduce this problem?
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* RE: [INTERFACES] Inifinite socket send from backend to java servl et
@ 1999-11-03 07:27 Peter Mount <petermount@it.maidstone.gov.uk>
0 siblings, 0 replies; 3+ messages in thread
From: Peter Mount @ 1999-11-03 07:27 UTC (permalink / raw)
To: 'Tom Lane' <tgl@sss.pgh.pa.us>; Rich Ryan <postgres@weblynk.com>; +Cc: pgsql-interfaces
I'm not sure about servlets myself, but they seem to bring in a new set
of problems, mainly because they all run under one process (as separate
threads). When they die, the socket isn't closed, as the parent process
is still running, etc.
I think this problem isn't necessarily a Java one, as thinking about it,
it could happen to any interface where there is a pool of connections
under one process. Perhaps we should have a time out (say fairly large)
where if the backend is waiting for the client to pull off data, it
closes itself down?
Peter
> -----Original Message-----
> From: Tom Lane [SMTP:tgl@sss.pgh.pa.us]
> Sent: 03 November 1999 06:09
> To: Rich Ryan
> Cc: pgsql-interfaces@postgreSQL.org
> Subject: Re: [INTERFACES] Inifinite socket send from backend to
> java servlet
>
> Rich Ryan <postgres@weblynk.com> writes:
> > I'm running RH Linux 5.2, Jdk 1.1.7v3 on machine A, and RH Linux
> 6.1,
> > postgres 6.5.2 on machine B. Some queries made from A to B never
> return. It
> > looks like the java servlet on machine A skipped out on the query or
> the
> > thread died or got interrupted or something, and machine B is
> infinitely
> > waiting for it to read query results.
>
> I'm not qualified to comment on (nor interested in) the problem with
> the
> java servlets, but I'd say they are pretty buggy if they're dying in
> the
> middle of reading query results.
>
> However, the backend ought to recover gracefully from client failure,
> and if it's not then I'm interested in that.
>
> > I get a ton of these messages...
>
> > FATAL: pq_endmessage failed: errno=32
> > pq_flush: send() failed: Broken pipe
>
> > Within a half day or so, my database connection pool is exhausted
> because
> > there taken up by these infinite waits.
>
> What is supposed to happen is that you get a few of these messages in
> the log while the backend tries to dump out the query results to the
> no-longer-connected client (maybe more than a few of them, if it was a
> big query :-(), and then when the backend finishes the query and tries
> to read the next command from the client, it notices that the client
> connection isn't there anymore, and gracefully exits. Apparently
> you've
> found a combination of circumstances where this doesn't happen like
> it's
> supposed to. I have no immediate ideas about why. Can anyone else
> reproduce this problem?
>
> regards, tom lane
>
> ************
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~1999-11-03 07:27 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-11-03 04:58 Inifinite socket send from backend to java servlet Rich Ryan <postgres@weblynk.com>
1999-11-03 06:09 ` Tom Lane <tgl@sss.pgh.pa.us>
1999-11-03 07:27 RE: [INTERFACES] Inifinite socket send from backend to java servl et Peter Mount <petermount@it.maidstone.gov.uk>
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