X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8BEFBD1B193 for ; Mon, 21 Jun 2004 23:02:21 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 40189-06 for ; Tue, 22 Jun 2004 02:02:16 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 8676ED1B1B6 for ; Mon, 21 Jun 2004 23:02:11 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=opencloud.com) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1Bcabz-0006m3-00; Tue, 22 Jun 2004 14:02:11 +1200 Message-ID: <40D7937A.3040703@opencloud.com> Date: Tue, 22 Jun 2004 14:03:38 +1200 From: Oliver Jowett User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Laurent Sylvain Cc: "'pgsql-jdbc@postgresql.org'" Subject: Re: Bug (and fix): leaks of TCP connections when connected References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS, SUBJ_HAS_SPACES X-Spam-Level: * X-Archive-Number: 200406/142 X-Sequence-Number: 10344 Laurent Sylvain wrote: > Hello, > > 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: In theory the discarded connections should eventually be garbage collected and closed, right? So at least the leak is bounded. (I'll check that this is fixed in my patches; I restructured that area quite a bit) -O