Node.java getLeavingTransitionsMap() not thread safe when constructing
leavingTransitionMap
-------------------------------------------------------------------------------------------
Key: JBPM-1766
URL:
https://jira.jboss.org/jira/browse/JBPM-1766
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Core Engine
Affects Versions: jBPM 3.3.0 CR1
Environment: N/A
Reporter: joe freeman
The code in getLeavingTransitionsMap() lazily constructs the map the first time the method
is called. Our application can have 100s of users going through the same node at the start
of their shift. It is possible to have more than one user leaving the first node at the
same time in the same VM. This can put multiple users in the getLeavingTransitionsMap()
method at the same time. We can get deadlock in the put() method for the map which means
no one else can enter the application. The block of code should be synchronized or the
map should be synchronized.
We're running just the jpdl which has this problem up through and including the
current 3.2.3 version
/**
* are the leaving {@link Transition}s, mapped by their name (java.lang.String).
*/
public Map getLeavingTransitionsMap() {
if ( (leavingTransitionMap==null)
&& (leavingTransitions!=null) ){
// initialize the cached leaving transition map
leavingTransitionMap = new HashMap();
ListIterator iter = leavingTransitions.listIterator(leavingTransitions.size());
while (iter.hasPrevious()) {
Transition leavingTransition = (Transition) iter.previous();
leavingTransitionMap.put(leavingTransition.getName(), leavingTransition);
}
}
return leavingTransitionMap;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira