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)" <ui...@incubator.apache.org> on 2009/07/31 22:39:14 UTC

[jira] Created: (UIMA-1476) Fix race condition in the UIMA As client when creating a shared JMS connection

Fix race condition in the UIMA As client when creating a shared JMS connection
------------------------------------------------------------------------------

                 Key: UIMA-1476
                 URL: https://issues.apache.org/jira/browse/UIMA-1476
             Project: UIMA
          Issue Type: Bug
          Components: Async Scaleout
            Reporter: Jerry Cwiklik
            Assignee: Jerry Cwiklik


When scaling a UIMA AS client in the same JVM there is a race condition that causes NullPointer exception. The exception is thrown when trying to access a JMSConnection object that is not yet initialized. The problem is in the setupConnection() method where the SharedConnection is initialized in two steps:

1) Default constructor creates an instance of the SharedConnection
2) setConnection method is called with a new Connection object

The problem is that the code in initialize() method checks if the sharedConnection != null and if so proceeds to initializeProducer() method. So the race condition is that SharedConnection constructor  finishes, a thread sees that it is not null and calls initializeProducer BEFORE the connection is set.

Fix the code so that connection is passed in as an argument to a constructor assuring that as soon as the SharedConnection is instantiated it is fully initialized


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (UIMA-1476) Fix race condition in the UIMA As client when creating a shared JMS connection

Posted by "Jerry Cwiklik (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik closed UIMA-1476.
-------------------------------

    Resolution: Fixed

Fixed race condition that causes NullPointerException while initializing multiple Uima AS clients in the same JVM

> Fix race condition in the UIMA As client when creating a shared JMS connection
> ------------------------------------------------------------------------------
>
>                 Key: UIMA-1476
>                 URL: https://issues.apache.org/jira/browse/UIMA-1476
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>            Reporter: Jerry Cwiklik
>            Assignee: Jerry Cwiklik
>
> When scaling a UIMA AS client in the same JVM there is a race condition that causes NullPointer exception. The exception is thrown when trying to access a JMSConnection object that is not yet initialized. The problem is in the setupConnection() method where the SharedConnection is initialized in two steps:
> 1) Default constructor creates an instance of the SharedConnection
> 2) setConnection method is called with a new Connection object
> The problem is that the code in initialize() method checks if the sharedConnection != null and if so proceeds to initializeProducer() method. So the race condition is that SharedConnection constructor  finishes, a thread sees that it is not null and calls initializeProducer BEFORE the connection is set.
> Fix the code so that connection is passed in as an argument to a constructor assuring that as soon as the SharedConnection is instantiated it is fully initialized

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (UIMA-1476) Fix race condition in the UIMA As client when creating a shared JMS connection

Posted by "Jerry Cwiklik (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik updated UIMA-1476:
--------------------------------

    Fix Version/s: 2.3AS

> Fix race condition in the UIMA As client when creating a shared JMS connection
> ------------------------------------------------------------------------------
>
>                 Key: UIMA-1476
>                 URL: https://issues.apache.org/jira/browse/UIMA-1476
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>            Reporter: Jerry Cwiklik
>            Assignee: Jerry Cwiklik
>             Fix For: 2.3AS
>
>
> When scaling a UIMA AS client in the same JVM there is a race condition that causes NullPointer exception. The exception is thrown when trying to access a JMSConnection object that is not yet initialized. The problem is in the setupConnection() method where the SharedConnection is initialized in two steps:
> 1) Default constructor creates an instance of the SharedConnection
> 2) setConnection method is called with a new Connection object
> The problem is that the code in initialize() method checks if the sharedConnection != null and if so proceeds to initializeProducer() method. So the race condition is that SharedConnection constructor  finishes, a thread sees that it is not null and calls initializeProducer BEFORE the connection is set.
> Fix the code so that connection is passed in as an argument to a constructor assuring that as soon as the SharedConnection is instantiated it is fully initialized

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.