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

Fix intermittent problem with CAS release while running scaled up AE in UIMA AS

    XMLWordPrintableJSON

Details

    Description

      While running extended tests on Mac, the testScaledSyncAggregateProcess() test failed with:

      org.apache.uima.analysis_engine.AnalysisEngineProcessException: CasManager.release(CAS) was called with a CAS that does not belong to this CasManager.\
      at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:701)\
      at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.<init>(ASB_impl.java:409)\
      at org.apache.uima.analysis_engine.asb.impl.ASB_impl.process(ASB_impl.java:342)\
      at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.processAndOutputNewCASes(AggregateAnalysisEngine_impl.java:267)\
      at org.apache.uima.aae.controller.PrimitiveAnalysisEngineController_impl.process(PrimitiveAnalysisEngineController_impl.java:514)\
      at org.apache.uima.aae.handler.HandlerBase.invokeProcess(HandlerBase.java:121)\
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handleProcessRequestFromRemoteClient(ProcessRequestHandler_impl.java:474)\
      at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handle(ProcessRequestHandler_impl.java:952)\
      at org.apache.uima.aae.handler.input.MetadataRequestHandler_impl.handle(MetadataRequestHandler_impl.java:78)\
      at org.apache.uima.adapter.jms.activemq.JmsInputChannel.onMessage(JmsInputChannel.java:702)\
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:535)\
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:495)\
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)\
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)\
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)\
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1056)\
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:952)\
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)\
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)\
      at org.apache.uima.aae.UimaAsThreadFactory$1.run(UimaAsThreadFactory.java:106)\
      at java.lang.Thread.run(Thread.java:680)\
      Caused by: org.apache.uima.UIMARuntimeException: CasManager.release(CAS) was called with a CAS that does not belong to this CasManager.\
      at org.apache.uima.resource.impl.CasManager_impl.releaseCas(CasManager_impl.java:131)\
      at org.apache.uima.cas.AbstractCas_ImplBase.release(AbstractCas_ImplBase.java:35)\
      at org.apache.uima.cas.impl.CASImpl.release(CASImpl.java:3604)\
      at org.apache.uima.cas.impl.CASImpl.release(CASImpl.java:3602)\
      at org.apache.uima.analysis_engine.asb.impl.ASB_impl$AggregateCasIterator.processUntilNextOutputCas(ASB_impl.java:689)\

      The above test deploys 5 instances of synchronous aggregate containing a CM and a NoOp Annotator. The CM generates 1 CAS for each input CAS. Total of 5 CASes are sent to the service for processing. Some of the CASes are processed and returned back to the client. I am not totally sure what the problem is at this time. It seems like the ASB is trying to release a child CAS when the above exception occurs. All instances of sync aggregates share Resource Manager containing common CasManager. Unable to reproduce this problem on Linux, Windows or Mac.

      Further diagnosis points toward an issue with the UIMA Java SDK, for use cases where multiple instances of an aggregate (containing a Cas Multiplier) are created and run using a shared common UIMA Context / Resource Manager. Several parts of the Resource Manager are not thread safe.

      Figure out where things like getEmptyCas need to be synchronized.
      Come up with a better test case (that isn't so intermittent).

      Attachments

        Issue Links

          Activity

            People

              schor Marshall Schor
              cwiklik Jaroslaw Cwiklik
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: