I suppose this particular problem is not related to isStale(), as I do not see in the logs any connections dropped because they appear to be 'stale'. I still lean toward assuming this is an issue with Todd' code, rather HttpClient itself.
I think the only problem is with HttpConnection.isStale(). I have done some timings and can confirm that isSale() significantly increases method execution time. In fact, when connecting to localhost, it is actually faster to create a new connection for each method execution than to reuse connections. This is obviously a bad thing.
I believe our only real option is to make isStale() optional and/or pluggable. Effective alternatives to isStale() have been thoroughly investigated and I think we can say that they do not exist, at least in a pre 1.4 environment. Does anyone have some new insight into this problem?
I would like to suggest that the problems are dealt with sequentially:
- fix isStale performance degradation problem. In the worse case, we can
simply make stale connection check optional, if we do not come up with
something better
- Retag HTTPCLIENT_2_0_RC1
- Get Todd upgrade to HTTPCLIENT_2_0_RC1
- See if we get more information about what it going on in the MTCM
As stated previously I do not think there is anything wrong with the MTCM. My guess is that the misunderstanding is being caused by the following DEBUG messages:
[java] [DEBUG] HttpConnection - -Creating connection for localhost using protocol http:80
These messages appear every time a connection is retrieved from the MTCM. This is because of the following line in MTCM.getConnection(HostConfiguration, long):
// wrap the connection in an adapter so we can ensure it is used // only once return new HttpConnectionAdapter(conn);
This connection adapter is created each time and is causing the DEBUG messages ( HttpConnection(String, int, String, String, int, Protocol) is the source). Perhaps we should find some way to remove these spurious messages.
Mike
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]