You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Jerry Cwiklik (JIRA)" <de...@uima.apache.org> on 2014/02/18 15:38:19 UTC

[jira] [Created] (UIMA-3630) Fix UIMA-AS race condition in JmsAnalysisEngineServiceStub

Jerry Cwiklik created UIMA-3630:
-----------------------------------

             Summary: Fix UIMA-AS race condition in JmsAnalysisEngineServiceStub
                 Key: UIMA-3630
                 URL: https://issues.apache.org/jira/browse/UIMA-3630
             Project: UIMA
          Issue Type: Bug
          Components: Async Scaleout
    Affects Versions: 2.4.2AS
            Reporter: Jerry Cwiklik
            Assignee: Jerry Cwiklik
             Fix For: 2.5.0AS


There is a race condition in the JmsAnalysisEngineServiceStub related to a recent code change where there is a single instance of uima-as client per jvm. All threads share this instance now.
The race happens when the process starts up. One thread is initializing uima-as client which takes some time. The code creates an instance of uima-as client, places it in Map under broker url key and begins initializing the client. Another thread checks if there is a instance of a client for a giving key, finds it and proceeds to calling sendAndReceive().
Since the client is still initializing, the sendAndReceive() throws Not Ready exception.
Add CountDownLatch to prevent threads from calling sendAndReceive() until the uima-as client initializes (latch down)



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)