Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 542556958 for ; Tue, 19 Jul 2011 15:53:50 +0000 (UTC) Received: (qmail 60037 invoked by uid 500); 19 Jul 2011 15:53:50 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 59973 invoked by uid 500); 19 Jul 2011 15:53:49 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 59965 invoked by uid 99); 19 Jul 2011 15:53:49 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2011 15:53:49 +0000 Received: from localhost (HELO mail-vx0-f179.google.com) (127.0.0.1) (smtp-auth username jonm, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Jul 2011 15:53:49 +0000 Received: by vxi32 with SMTP id 32so2678932vxi.10 for ; Tue, 19 Jul 2011 08:53:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.92.84 with SMTP id ck20mr7538579vdb.376.1311090828047; Tue, 19 Jul 2011 08:53:48 -0700 (PDT) Received: by 10.52.113.163 with HTTP; Tue, 19 Jul 2011 08:53:48 -0700 (PDT) X-Originating-IP: [75.149.106.130] Date: Tue, 19 Jul 2011 11:53:48 -0400 Message-ID: Subject: question about ConnPoolByRoute#freeEntry From: Jon Moore To: HttpComponents Project Content-Type: text/plain; charset=ISO-8859-1 I was in the process of working on the connection reuse strategy in the context of HTTPCLIENT-1108, and was adding unit tests, when I ran across this: If I obtain a BasicPoolEntry and then return it to the pool via freeEntry() with reusable set to "false", the underlying connection doesn't actually get closed there, which seems odd to me. Roughly, the code says: if (reusable) { // add to free pool } else { rospl.dropEntry(); // this doesn't close the entry's connection either numConnections--; } So it seems like we are just losing all the references to the underlying OperatedClientConnection; is it getting closed via GC or finalization then? Seems like adding a closeConnection(entry) to the "else" clause above would be the right thing to do. Or am I misunderstanding how this works? Thanks, Jon --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org For additional commands, e-mail: dev-help@hc.apache.org