UIMA
  1. UIMA
  2. UIMA-1400

Uima aggregate with embedded Cas Multiplier fails if one attempts to create multiple instances of it in the same JVM

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: 2.3
    • Component/s: Core Java Framework
    • Labels:
      None

      Description

      When trying to scale Uima aggregate with a Cas Multiplier in the same JVM, the code fails with the following:

      org.apache.uima.analysis_engine.AnalysisEngineProcessException: The
      method CasManager.defineCasPool() was called twice by the same Analysis
      Engine

      This is due to the fact that the CasManager creates a single CAS pool for any given Cas Multiplier, no matter how many instances of it are created. The first instance of a particular CM creates a CAS Pool and the pool is associated with that instance using a CM's qualified name obtained from the component's uima context. The second instance of the same CM fails, since its trying to create another CAS pool with the same qualified name as the first instance.

      Create and assign a unique name in the Uima context for each instance of a component. Use the unique name when calling defineCasPool() so that every instance of the CM component creates its own CAS pool.

        Issue Links

          Activity

          Hide
          Marshall Schor added a comment -

          This is currently working, but impl is forcing users of the CasManager to serialize themselves. See UIMA-1598.

          Show
          Marshall Schor added a comment - This is currently working, but impl is forcing users of the CasManager to serialize themselves. See UIMA-1598 .
          Hide
          Marshall Schor added a comment -

          made new issue for making CasManager_impl thread-safe

          Show
          Marshall Schor added a comment - made new issue for making CasManager_impl thread-safe
          Hide
          Marshall Schor added a comment - - edited

          If UIMA-1223 did not make the thread-safety issue raised by Joern above moot, then I'm +1 for fixing the thread saftey issue and maybe also UIMA-1249, for the 2.3.0 release, because this kind of issue (if it happens) becomes very hard to track down, and could impact our "reputation".

          Show
          Marshall Schor added a comment - - edited If UIMA-1223 did not make the thread-safety issue raised by Joern above moot, then I'm +1 for fixing the thread saftey issue and maybe also UIMA-1249 , for the 2.3.0 release, because this kind of issue (if it happens) becomes very hard to track down, and could impact our "reputation".
          Hide
          Joern Kottmann added a comment -

          Can we fix the thread safety issue for 2.3.0 ?

          Show
          Joern Kottmann added a comment - Can we fix the thread safety issue for 2.3.0 ?
          Hide
          Marshall Schor added a comment -

          Jerry - can you update the status of this in preparation for 2.3.0 release?

          Show
          Marshall Schor added a comment - Jerry - can you update the status of this in preparation for 2.3.0 release?
          Hide
          Joern Kottmann added a comment -

          For me it looks like that the CasManager_Impl should be thread safe but it isn't. Which could lead to problems when instating multiple Cas Multiplier instances at the same time in multiple threads like UIMA AS does.

          Show
          Joern Kottmann added a comment - For me it looks like that the CasManager_Impl should be thread safe but it isn't. Which could lead to problems when instating multiple Cas Multiplier instances at the same time in multiple threads like UIMA AS does.
          Hide
          Jerry Cwiklik added a comment -

          Modified uima context code to create a unique name for every instance of a component. The unique name is generated using RMI's UID generator. When an instance of a component needs to create a CAS pool it will use the unique name as an argument to the CasManager's defineCasPool() method. This mechanism now allows the CasManager to create and manage a per instance CAS pool.

          Show
          Jerry Cwiklik added a comment - Modified uima context code to create a unique name for every instance of a component. The unique name is generated using RMI's UID generator. When an instance of a component needs to create a CAS pool it will use the unique name as an argument to the CasManager's defineCasPool() method. This mechanism now allows the CasManager to create and manage a per instance CAS pool.

            People

            • Assignee:
              Jerry Cwiklik
              Reporter:
              Jerry Cwiklik
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development