hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roland Weber (JIRA)" <j...@apache.org>
Subject [jira] Created: (HTTPCLIENT-675) thread starving in MultiThreadedHttpConnectionManager
Date Thu, 26 Jul 2007 18:18:03 GMT
thread starving in MultiThreadedHttpConnectionManager
-----------------------------------------------------

                 Key: HTTPCLIENT-675
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-675
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpConn
    Affects Versions: 3.1 RC1
            Reporter: Roland Weber
            Assignee: Roland Weber
             Fix For: 3.1 Final


Hi folks,

I might have found a bug in MTHCM. It has to do with removing HostConnectionPool instances
that have no more connections in them. That was a fix for a memory leak we previously had.
There are two cases where the pools get deleted. One is in handleLostConnection: (excerpt)
  ...
  if (hostPool.numConnections == 0) mapHosts.remove(config);
  notifyWaitingThread(config);
  ...

Could this delete a pool in which there is still a thread waiting to get a connection? If
so, the thread would remain in the global pool. But even if it is interrupted there, it would
still use the old HostConnectionPool in which no connection will ever become available again.

I suggest to change the removal check in both cases to:
  if ((hostPool.numConnections < 1) && hostPool.waitingThreads.isEmpty)

What do you think?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message