5 Apr 15:42
[jira] Created: (UIMA-367) Deadlock can occur in MultiprocessingAnalysisEngine_impl.setResultSpecification
Deadlock can occur in MultiprocessingAnalysisEngine_impl.setResultSpecification
-------------------------------------------------------------------------------
Key: UIMA-367
URL: https://issues.apache.org/jira/browse/UIMA-367
Project: UIMA
Issue Type: Bug
Components: Core Java Framework
Affects Versions: 2.1
Reporter: Adam Lally
Assigned To: Adam Lally
Fix For: 2.2
User reports unit test frequently hangs at the following location:
----------------
Thread [Thread-1] (Suspended)
Object.wait(long) line: not available [native method]
ResourcePool.getResource(long) line: 166
AnalysisEnginePool.setResultSpecification(ResultSpecification) line:
155
MultiprocessingAnalysisEngine_impl.setResultSpecification(ResultSpecification)
line: 122
MultiprocessingAnalysisEngine_impl(AnalysisEngineImplBase).process(CAS,
ResultSpecification) line: 200
MultiprocessingAnalysisEngine_implTest$ProcessThread.run() line: 363
-------------------
I took a look at the code for
AnalysisEnginePool.setResultSpecification. It tries to set the result
specification of all AEs in the pool. To do this it attempts to check
out all instances from the pool, set their result spec, and then
releases them all. If this method is executed simultaneously from two
threads, it can easily result in deadlock (each thread has some
portion of the instances checked out and is trying to check out the
remainder of them, and both will wait forever).
And this method is called from the process(CAS, ResultSpecification)
method, called in this test case from multiple threads.
This design is broken and must be fixed.
--
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
RSS Feed