mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.2 to HEAD
17171: Possible fix to latest intermittent concurrency issues in V3.2 build - PersonTest needs to do its ref checking in a new transaction and concurrent hash map used for thread safety - Thread safety of ReaderManagementPool singleton git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17173 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -29,6 +29,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@@ -576,7 +577,7 @@ public class PersonTest extends BaseSpringTest
|
||||
int threadCount = 10;
|
||||
final CountDownLatch startLatch = new CountDownLatch(threadCount);
|
||||
final CountDownLatch endLatch = new CountDownLatch(threadCount);
|
||||
final Map<String, NodeRef> cleanableNodeRefs = new HashMap<String, NodeRef>(17);
|
||||
final Map<String, NodeRef> cleanableNodeRefs = new ConcurrentHashMap<String, NodeRef>(17);
|
||||
Runnable createPersonRunnable = new Runnable()
|
||||
{
|
||||
public void run()
|
||||
@@ -642,7 +643,11 @@ public class PersonTest extends BaseSpringTest
|
||||
return personService.getPerson(duplicateUsername);
|
||||
}
|
||||
};
|
||||
NodeRef remainingNodeRef = transactionService.getRetryingTransactionHelper().doInTransaction(getPersonWork, false, true);
|
||||
final NodeRef remainingNodeRef = transactionService.getRetryingTransactionHelper().doInTransaction(getPersonWork, false, true);
|
||||
transactionService.getRetryingTransactionHelper().doInTransaction(new RetryingTransactionCallback<Object>(){
|
||||
|
||||
public Object execute() throws Throwable
|
||||
{
|
||||
// Should all be cleaned up now, but no way to check
|
||||
for (NodeRef nodeRef : cleanableNodeRefs.values())
|
||||
{
|
||||
@@ -656,5 +661,8 @@ public class PersonTest extends BaseSpringTest
|
||||
fail("Expected unused person noderef to have been cleaned up: " + nodeRef);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}, true, true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user