UIMA
  1. UIMA
  2. UIMA-2414

Fix ConcurrentModificationException in uima-as client

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.1AS
    • Fix Version/s: 2.4.0AS
    • Component/s: Async Scaleout
    • Labels:
      None

      Description

      The uima-as client throws

      org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl WARN 2012-05-25 01:08:41,391 [BaseUIMAAsynchronousEngineCommon_impl$2.2] - java.util.ConcurrentModificationException at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:64) at org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl.handleServiceInfo(BaseUIMAAsynchronousEngineCommon_impl.java:1121)

      while handling ServiceInfo message from a remote service. The service sends this message right after it picks up a request msg from a queue and before calling AE's process method. The msg includes service host ip, process PID, and a service temp queue for receiving FreeCas requests (if the service is a CM). This temp queue is also used by the client to send a a Stop request to the CM to abort generation of child CASes. The above exception happens while iterating over a list of outstanding CASes. The code is trying to locate a matching CAS (by id) and to associate with it received temp reply queue in case application wants to abort the CAS. Access to the list is not synchronized in this case and causes the exception. Refactor client code to prevent concurrent access to the list.

        Activity

        Hide
        Jerry Cwiklik added a comment -

        Modified Delegate class to lock access to outstanding CAS list. Removed getDelegateCasesPendingReply() as it returned the list to clients (callers) which led to the ConcurrentModificationException. Instead provided a new API the clients can call to get an array of CAS Ids that are outstanding. This approach localizes direct access to the outstanding CAS list.

        Show
        Jerry Cwiklik added a comment - Modified Delegate class to lock access to outstanding CAS list. Removed getDelegateCasesPendingReply() as it returned the list to clients (callers) which led to the ConcurrentModificationException. Instead provided a new API the clients can call to get an array of CAS Ids that are outstanding. This approach localizes direct access to the outstanding CAS list.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development