[infinispan-issues] [JBoss JIRA] (ISPN-1689) DefaultCacheManager.getDefaultCacheConfiguration() gives a wrong value for the consistent hash when it is not set

Nicolas Filotto (JIRA) jira-events at lists.jboss.org
Wed Jan 11 11:59:22 EST 2012


     [ https://issues.jboss.org/browse/ISPN-1689?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Filotto updated ISPN-1689:
----------------------------------

    Attachment:     (was: ISPN-1689.patch)

    
> DefaultCacheManager.getDefaultCacheConfiguration() gives a wrong value for the consistent hash when it is not set
> -----------------------------------------------------------------------------------------------------------------
>
>                 Key: ISPN-1689
>                 URL: https://issues.jboss.org/browse/ISPN-1689
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Core API
>    Affects Versions: 5.1.0.CR2
>            Reporter: Nicolas Filotto
>            Assignee: Manik Surtani
>            Priority: Critical
>             Fix For: 5.1.0.FINAL
>
>         Attachments: ISPN-1689.patch
>
>
> Since I upgraded my code to use the new configuration object I realized that the starting time was much slower, after a deeper investigation I realized that the application was stuck at {{BaseStateTransferManagerImpl.waitForJoinToComplete()}} because the latch was not released due to the following exception:
> {code}
> java.lang.ClassCastException: org.infinispan.remoting.transport.jgroups.JGroupsAddress cannot be cast to org.infinispan.remoting.transport.TopologyAwareAddress
> 	at org.infinispan.distribution.ch.TopologyAwareConsistentHash.setCaches(TopologyAwareConsistentHash.java:79)
> 	at org.infinispan.distribution.ch.ConsistentHashHelper.createConsistentHash(ConsistentHashHelper.java:114)
> 	at org.infinispan.statetransfer.ReplicatedStateTransferManagerImpl.createConsistentHash(ReplicatedStateTransferManagerImpl.java:56)
> 	at org.infinispan.statetransfer.BaseStateTransferManagerImpl.prepareView(BaseStateTransferManagerImpl.java:310)
> 	at org.infinispan.cacheviews.CacheViewsManagerImpl.handlePrepareView(CacheViewsManagerImpl.java:463)
> 	at org.infinispan.cacheviews.CacheViewsManagerImpl.clusterPrepareView(CacheViewsManagerImpl.java:300)
> 	at org.infinispan.cacheviews.CacheViewsManagerImpl.clusterInstallView(CacheViewsManagerImpl.java:249)
> 	at org.infinispan.cacheviews.CacheViewsManagerImpl$ViewInstallationTask.call(CacheViewsManagerImpl.java:850)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:680)
> {code}
> Then I compared the old configuration with the new configuration and realized that {{org.infinispan.distribution.ch.TopologyAwareConsistentHash}} was wrongly added to my configuration as consistent hash. That is actually because when I call {{DefaultCacheManager.getDefaultCacheConfiguration()}}, it internally calls {{LegacyConfigurationAdaptor.adapt}} which calls {{legacy.getConsistentHashClass()}} to know if a hash class is set but in practice it cannot be null if it is null it sets a default value but since the global configuration is null it is set to {{org.infinispan.distribution.ch.TopologyAwareConsistentHash}} which is not what is expected. See below the corresponding code:
> {code}
>    public String getConsistentHashClass() {
>       if (clustering.hash.consistentHashClass == null) {
>          clustering.hash.consistentHashClass = globalConfiguration == null || globalConfiguration.hasTopologyInfo() ? TopologyAwareConsistentHash.class.getName() : DefaultConsistentHash.class.getName();
>       }
>       return clustering.hash.consistentHashClass;
>    }
> {code}

--
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 infinispan-issues mailing list