[jboss-jira] [JBoss JIRA] Created: (JBMESSAGING-819) Use of stopping flag in DefaultClusteredPostOffice introduces race conditions

Tim Fox (JIRA) jira-events at jboss.com
Thu Feb 8 07:46:34 EST 2007


Use of stopping flag in DefaultClusteredPostOffice introduces race conditions
-----------------------------------------------------------------------------

                 Key: JBMESSAGING-819
                 URL: http://jira.jboss.com/jira/browse/JBMESSAGING-819
             Project: JBoss Messaging
          Issue Type: Bug
    Affects Versions: 1.2.0.Beta2
            Reporter: Tim Fox
         Assigned To: Tim Fox
             Fix For: 1.2.0.CR1


Using a stopping flag is not a good approach and introduces a race condition the code can check stopping and find it to be false, then the service can stop, setting stopping to true then actually stopping the post office, then the same thread that checked stopping continues and performs its action only to find the service stopped.
Should use a read-write lock instead.
One way to minimise the chance of the race happening is to sleep for a little while after setting stopping to true before actually stopping the service (see below)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list