commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33949] New: - genericKeyedObjectPool.borrowObject() calls activateObject in synchronized mode
Date Thu, 10 Mar 2005 11:04:34 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=33949>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33949

           Summary: genericKeyedObjectPool.borrowObject() calls
                    activateObject in synchronized mode
           Product: Commons
           Version: 1.2 Final
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Pool
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: Georg.Koltermann@mscsoftware.com


This is in commons-pool rel. 1.2

The method borrowObject in genericKeyedObjectPool is synchronized.
It first retrieves a poolable object from its internal data structures
and then calls _factory.activateObject() for it. 

The problem is, if the activateObject() takes a while (e.g. for a DB connection
it might probe if the connection is still alive, and that takes a while on broken
network connections), then the thread will be stuck.  And since the call
is made from out of the synchronized borrowObject(), the whole pool
will be blocked for quite a while!

I'd suggest to explicitly synchronize around the critical parts of the
method which access internal data structures, but to call the
activateObject method from non-synchronized code.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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


Mime
View raw message