Return-Path: Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 72125 invoked from network); 10 Apr 2003 02:53:41 -0000 Received: from mxout3.cac.washington.edu (140.142.32.166) by daedalus.apache.org with SMTP; 10 Apr 2003 02:53:41 -0000 Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout3.cac.washington.edu (8.12.1+UW03.04/8.12.1+UW02.12) with ESMTP id h3A2roSL015055 for ; Wed, 9 Apr 2003 19:53:51 -0700 Received: from u.washington.edu (pool-129-44-175-110.bos.east.verizon.net [129.44.175.110]) (authenticated bits=0) by smtp.washington.edu (8.12.1+UW03.04/8.12.1+UW02.12) with ESMTP id h3A2rn8G021130 (version=TLSv1/SSLv3 cipher=DES-CBC3-SHA bits=168 verify=NOT) for ; Wed, 9 Apr 2003 19:53:50 -0700 Date: Wed, 9 Apr 2003 22:53:48 -0400 Subject: Re: MultiThreadedHttpConnectionManager Questions Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v551) From: Michael Becke To: "Commons HttpClient Project" Content-Transfer-Encoding: 7bit In-Reply-To: <3E81214E-6ADD-11D7-95E4-000393016056@intencha.com> Message-Id: X-Mailer: Apple Mail (2.551) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi Adrian, > Firstly, the method: > public HttpConnection getConnection(HostConfiguration > hostConfiguration) > > has a while (true) loop that catches and logs all HttpExceptions. The > method doesn't claim to thrown IOExceptions so it looks like if > something goes wrong it will loop forever. I can't believe noone's > run into this problem yet (though it may be contributing to some of > the threads going awol in bug 18596 that Mike has been working on). I > have asked the user to file a bug report on this to be sure the > concern isn't lost anyway. This method looks a little suspicious at first I agree. Though, as it turns out the HttpException is only thrown when a connection wait timeout occurs. In the case of getConnection(HostConfiguration) this will never occur since we are waiting indefinitely. The try/catch/loop is just there to make the compiler happy, and the LOG statement was added for completeness. I have added a comment detailing this to my latest patch for bug 18596. > Secondly, an enquiry came through regarding how to determine the > number of "connections available" (where "connections available" means > free connections + connections that can be created before reaching > maxConnections). I suggested: > > manager.getMaxConnectionsPerHost() - > manager.getConnectionsInUse(hostConfiguration); > > However the proposed patch for bug 18596 makes this more complex. So > could there be a request for a method that determines how many > connections can be made gets added? The patch for 18596 has methods for getting the max number of connections and the total number in use. Are you also wondering how many idle connections there are? Mike