Uploaded image for project: 'UIMA'
  1. UIMA
  2. UIMA-1248

ResourceManager initialization is not thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.2.2, 2.3
    • 2.6.0SDK
    • Core Java Framework
    • 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

          Activity

            People

              schor Marshall Schor
              alally Adam P. Lally
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: