hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Moore <j...@apache.org>
Subject question about ConnPoolByRoute#freeEntry
Date Tue, 19 Jul 2011 15:53:48 GMT
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

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?


To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message