]
Yong Hao Gao closed JBMESSAGING-1954.
-------------------------------------
Resolution: Done
revision 8631
MessagePostOffice.routeInternal() method may fail to release the
readlock
-------------------------------------------------------------------------
Key: JBMESSAGING-1954
URL:
https://issues.jboss.org/browse/JBMESSAGING-1954
Project: JBoss Messaging
Issue Type: Bug
Components: Messaging Core
Affects Versions: 1.4.8.SP11
Reporter: Yong Hao Gao
Assignee: Yong Hao Gao
Fix For: 1.4.8.SP12
This method first grabs the read lock and then release it in the finally block. However
some statements are outside the try{}finally block so there is a chance the lock will
never be released. The code is something like:
private RouteResult routeInternal(...) throws Exception
{
//get the read lock
lock.readLock().acquire();
...
//check inactive condition
if (inactiveConditions.contains(condition))
{
//look if this happens the readlock will NEVER be released!!!!
throw new IllegalStateException("Destination " + condition + "
not active!");
}
try
{
//do somework
......
}
finally
{
//release lock here
lock.readLock().release();
}
Once it happens, it will block any attempts to get the write lock, and also block any
further attempts to get read lock. Make those threads blocking forever.