Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.2AS
-
None
Description
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)