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 2016/03/17 15:31:33 UTC

[jira] [Closed] (UIMA-4857) UIMA-AS: Fix NullPointerException

     [ https://issues.apache.org/jira/browse/UIMA-4857?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik closed UIMA-4857.
-------------------------------
    Resolution: Fixed

Fixed race condition by moving code before send(). This code was trying to access CAS entry in a cache after the send. Since this NPE happened while running extended jUnit tests, the client replied fast and the CAS cache entry was deleted.

> UIMA-AS: Fix NullPointerException
> ---------------------------------
>
>                 Key: UIMA-4857
>                 URL: https://issues.apache.org/jira/browse/UIMA-4857
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>            Reporter: Jerry Cwiklik
>            Assignee: Jerry Cwiklik
>             Fix For: 2.8.1AS
>
>
> Fix NPE in the UIMA-AS service caused by a race condition when the service (remote multiplier) sends child CASes to a client. 
> For each child it receives, the client sends a message to the service to free the CAS. Upon receipt of the message the service removes CAS from its cache.
> The race condition is as follows:
> 1) Service in Thread 1 sends child CAS to client and the OS suspends the thread.
> 2) Client immediately sends request to free CAS to the service
> 3) Service in Thread 2 receives request to free CAS and deletes it from its cache.
> 4) Service in Thread 1 looks up the CAS in its cache and gets NULL (since the CAS was deleted in 3) above.
> So the problem is that right after sending a child CAS to a client, the service tries to access cache entry for this CAS to change the state of the cache entry.
> Move the cache look up and state change *before* the send. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)