On Thu, Oct 16, 2008 at 4:57 PM, Rob Heittman <[EMAIL PROTECTED]>wrote:
> Pragmatically, our applications do reuse Client instances in production > code and have not had any trouble with this. It's meant to be thread safe. > Tim points out a valid thread safety issue, but it's not likely to cause > you harm and will probably be corrected eventually. > While I was looking to see if there were any obvious serious thread-safety issues in Client and friends, I noticed a few minor things that should probably be fixed: - ConnectorHelper has volatile field protocols, which could and should be final. - ConnectorHelper start/stop both have useless synchronized keywords. - ClientHelper.connectTimeout is neither guarded by a lock nor volatile (similar to connectTimeout in Client). On a related note, Leigh Klotz pointed out privately to me that the handlers that set the current request, response, and context don't nest consistently, and there is a potential for memory leaks. The documentation says not to rely to heavily on the static getCurrent() methods, so maybe it's my own fault for writing the Guice FinderFactoryModule in terms of them, but the possibility of a memory leak is worth checking out. --tim

