Details
-
Bug
-
Resolution: Done
-
Blocker
-
None
-
None
-
None
Description
SourceForge Submitter: schrouf .
org.jboss.resource.connectionmanager.InternalManagedC
onnectionPool contains a serious synchronization bug in
method returnConnection().
The code
if (cl.hasPermit())
{
cl.grantPermit(false);
permits.release();
}
has to be included into the synchronized code section
after cls.add(cl). Otherwise it is possible that the
returned connection will be handed out to another
thread in getConnection() before reaching the finally
block in returnConnection(). In this situation the
releasing thread will call cl.grantPermit(false) on a
connection that is already in use by another thread (
overwriting its cl.grantPermit(true) on that connection).
This will cause a non-execution of the semaphore
release on next return of that connection which leads to
a final internal semaphore permit count of 1 (no
connection pooling at all...)
I will fix this in Brach_3_2 and HEAD