Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.2.2, 2.3
-
None
Description
If multiple threads concurrently call UIMAFramework.produceAnalysisEngine and pass the same instance of ResourceManager as an argument, you can get intermittent exceptions in the ResourceManager such as:
java.lang.ArrayIndexOutOfBoundsException
at java.lang.System.arraycopy(Native Method)
at java.util.ArrayList.ensureCapacity(ArrayList.java:170)
at java.util.ArrayList.add(ArrayList.java:351)
at org.apache.uima.resource.impl.CasManager_impl.addMetaData(CasManager_impl.java:82)
at org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase.initialize(AnalysisEngineImplBase.java:115)
at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:126)
The workaround is to synchronize the calls to UIMAFramework.produceAnalysisEngine. However, this is suboptimal if annotator initialization is expensive and you want it to be run in parallel on multiple cores. We should consider adding synchronization to the ResourceManager (and the classes it delegates to such as CasManager) to allow this to work.
Attachments
Issue Links
- is depended upon by
-
UIMA-1223 Annotators should be initialized in the same thread that their process method will later be called on
- Closed
- is superceded by
-
UIMA-3688 improve multi-core possibilites with ResourceManager_impl
- Resolved
-
UIMA-3691 support multi-threaded shared contexts for CasPools for CAS Multipliers
- Resolved
-
UIMA-3694 allow parallel initialization of components to speed things up in multi-core sys
- Resolved
- relates to
-
UIMA-1249 CasManager_impl logic for lazy merge of the type system could lead to excessive work or missed errors
- Resolved
- supercedes
-
UIMA-1598 make CasManager_impl thread-safe
- Resolved