[ 
https://issues.apache.org/jira/browse/POOL-125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700182#action_12700182
 ] 

John Bollinger commented on POOL-125:
-------------------------------------

Aha.  I misunderstood the nature of the problem.  I thought it was about two or 
more factory methods being invoked concurrently *on the same pooled object*, 
but it's really about issues that can arise in general if the client-provided 
object factory is not thread safe. (Right?)  I think it's rather accommodating 
of you to handle it with a code fix.  Indeed, I cannot imagine how a 
comprehensive fix could avoid unnecessarily reducing performance in cases where 
the object factory in use is already thread safe.  I also don't see how Pool 
can protect against non-thread-safe object factories being used concurrently by 
the Pool and by another client (which is, in a sense, what happened in DBCP-44).

You said you already have a patch for GOP, but are you sure it wouldn't be 
better to document that users must provide a thread-safe object factory?  They 
can always use one of the PoolUtil.synchronizedPoolableFactory() methods to get 
one if they need to do, though it would be better to use a factory that does 
not require synchronization for thread safety.

> Insufficient control over concurrent access to pooled objects by Evictor, 
> client threads
> ----------------------------------------------------------------------------------------
>
>                 Key: POOL-125
>                 URL: https://issues.apache.org/jira/browse/POOL-125
>             Project: Commons Pool
>          Issue Type: Bug
>    Affects Versions: 1.2, 1.4
>            Reporter: Phil Steitz
>             Fix For: 1.5
>
>
> In pool 1.2, 1.4, borrowObject, returnObject, invalidateObject are not fully 
> synchronized.  This creates the potential for race conditions vis a vis the 
> Evictor and/or client object lock contention.  Factory methods on pooled 
> objects should not be allowed to be invoked concurrently by client threads 
> and the Evictor.

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

Reply via email to