[jbosscache-issues] [JBoss JIRA] (JBCACHE-1605) Concurrency issues with multiple threads calling cache.start

Dennis Reed (Commented) (JIRA) jira-events at lists.jboss.org
Thu Oct 6 19:38:16 EDT 2011


    [ https://issues.jboss.org/browse/JBCACHE-1605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632926#comment-12632926 ] 

Dennis Reed commented on JBCACHE-1605:
--------------------------------------

Root cause is in ComponentRegistry, in the methods that change the state.
They all do something similar to:

if ( state == CREATED ) {
    ...
    state = STARTING
}

Fixed by adding "synchronized" to these methods (create/start/stop/destroy).
The other accesses to the state only read it, and it's already volatile, so no synchronization is needed there.

                
> Concurrency issues with multiple threads calling cache.start
> ------------------------------------------------------------
>
>                 Key: JBCACHE-1605
>                 URL: https://issues.jboss.org/browse/JBCACHE-1605
>             Project: JBoss Cache
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.2.8.GA
>            Reporter: Dennis Reed
>            Assignee: Dennis Reed
>
> There is no synchronization on cache.start, and concurrent calls to start the same cache cause errors.
> This is particularly an issue in AS 5, where caches are retrieved from the EAP CacheManager 
> and the first user of the cache must start it.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosscache-issues mailing list