I was looking at some of the optimisations in the JCA code and it looks like there is a
potential race condition in the PoolFiller implementation, just wanted to check if you
wanted a Jira task raising so it can be addressed?
http://anonsvn.jboss.org/repos/jbossas/branches/Branch_4_2/connector/src/...
The class PoolFiller.java uses two seperate synchronized blocks in the run method
| while (true)
| {
| try
| {
| InternalManagedConnectionPool mcp = null;
| //keep iterating through pools till empty, exception escapes.
| while (true)
| {
|
| synchronized (pools)
| {
| mcp = (InternalManagedConnectionPool)pools.removeFirst();
| }
| if (mcp == null)
| break;
|
| mcp.fillToMin();
| }
| }
| catch (Exception e)
| {
| }
|
| try
| {
| synchronized (pools)
| {
| pools.wait();
| }
| }
| catch (InterruptedException ie)
| {
| return;
| }
| }
It is possible that after the first synchronized block has finished a new connection pool
is added to the list of pools before the second block is reached, the second block
unconditionally waits and does not check that the list of pools is empty.
The wait could be wrapped with a call to isEmpty: -
| if (pools.isEmpty())
| {
| pools.wait();
| }
Or both synchronized blocks could be merged into one.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4019289#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...