Re: Bug (and fix): leaks of TCP connections when connected

From: Kris Jurka <books(at)ejurka(dot)com>
To: Laurent Sylvain <sylvain(dot)laurent(at)elca(dot)ch>
Cc: "'pgsql-jdbc(at)postgresql(dot)org'" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Bug (and fix): leaks of TCP connections when connected
Date: 2004-06-22 09:37:15
Message-ID: Pine.BSO.4.56.0406220433020.20144@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mon, 21 Jun 2004, Laurent Sylvain wrote:

> I experienced some TCP connection leaks when using PGSQL JDBC driver 7.4
> (build 214) to connect to a 7.3.4 server.
> The symptoms are that when performing a netstat on the client machine, many
> connections were in the CLOSE_WAIT state.
>
> The problem is that the driver tries to connect using v3 protocol and when
> it sees that the server doesn't understand it, it opens a new connection
> (PGStream) to the server without closing the previous one:
>

I've applied the attached patch to the 7.4 and 7.5 cvs trees. It adds the
pgStream.close() you suggested as well as closing the stream for other
connection failures such as authentication failures or lack of ssl
support.

Kris Jurka

Attachment Content-Type Size
tcpclose.patch text/plain 1.9 KB

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message David Wall 2004-06-22 14:52:24 Re: Bug (and fix): leaks of TCP connections when connected
Previous Message Laurent Sylvain 2004-06-22 07:15:57 Re: Bug (and fix): leaks of TCP connections when connected