mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged BRANCHES/V3.3 to HEAD:
20109: Fix for ALF-2706 "ConcurrentModificationException in AsynchronousActionExecutionQueueImpl" git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@20257 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,13 +19,13 @@
|
|||||||
package org.alfresco.repo.action;
|
package org.alfresco.repo.action;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
import org.alfresco.error.StackTraceUtil;
|
import org.alfresco.error.StackTraceUtil;
|
||||||
@@ -46,7 +46,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
|||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.alfresco.service.transaction.TransactionService;
|
import org.alfresco.service.transaction.TransactionService;
|
||||||
import org.alfresco.util.EqualsHelper;
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
@@ -65,7 +64,7 @@ public class AsynchronousActionExecutionQueueImpl implements AsynchronousActionE
|
|||||||
private AuthenticationContext authenticationContext;
|
private AuthenticationContext authenticationContext;
|
||||||
private PolicyComponent policyComponent;
|
private PolicyComponent policyComponent;
|
||||||
private Map<String, AbstractAsynchronousActionFilter>
|
private Map<String, AbstractAsynchronousActionFilter>
|
||||||
actionFilters = new HashMap<String, AbstractAsynchronousActionFilter>();
|
actionFilters = new ConcurrentHashMap<String, AbstractAsynchronousActionFilter>();
|
||||||
|
|
||||||
private NodeService nodeService;
|
private NodeService nodeService;
|
||||||
|
|
||||||
@@ -269,9 +268,13 @@ public class AsynchronousActionExecutionQueueImpl implements AsynchronousActionE
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
// Now we've found a registered action that matches the current one.
|
// Now we've found a registered action that matches the current one.
|
||||||
// So we'll go through the actions that are ongoing and consider them for matches with this one.
|
// So we'll go through the actions that are ongoing and consider them for matches with this one.
|
||||||
|
// Need to synchronize to prevent changes to ongoingActions whilst iterating. Assume that ongoingActions
|
||||||
|
// is not going to be too big and the loop will execute quite quickly, so that the synchronization
|
||||||
|
// will not impact concurrency too much.
|
||||||
|
synchronized(this.ongoingActions)
|
||||||
|
{
|
||||||
for (OngoingAsyncAction ongoingAction : this.ongoingActions)
|
for (OngoingAsyncAction ongoingAction : this.ongoingActions)
|
||||||
{
|
{
|
||||||
if (comparator.compare(ongoingAction, nodeBeingNewlyActioned) == 0)
|
if (comparator.compare(ongoingAction, nodeBeingNewlyActioned) == 0)
|
||||||
@@ -282,6 +285,7 @@ public class AsynchronousActionExecutionQueueImpl implements AsynchronousActionE
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (newActionShouldBeFilteredOut)
|
if (newActionShouldBeFilteredOut)
|
||||||
{
|
{
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
|
Reference in New Issue
Block a user