Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-6293

Registering a clustered listener in a DIST cluster leads to SuspectException if one member is not joined yet

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.2.0.Final, 8.1.3.Final
    • 8.2.0.Beta2
    • None
    • None

      Reproducer:

      import org.infinispan.configuration.cache.CacheMode;
      import org.infinispan.configuration.cache.ConfigurationBuilder;
      import org.infinispan.notifications.Listener;
      import org.infinispan.notifications.cachelistener.annotation.CacheEntryCreated;
      import org.infinispan.notifications.cachelistener.event.CacheEntryEvent;
      import org.infinispan.test.MultipleCacheManagersTest;
      import org.testng.annotations.Test;
      
      @Test(groups = "functional", testName = "ClusteredListenerJoinsTest")
      public class ClusteredListenerJoinsTest extends MultipleCacheManagersTest {
      
         @Listener(clustered = true)
         private static final class NoOpListener {
      
            @CacheEntryCreated
            public void handleEvent(CacheEntryEvent<Object, Object> e) {
            }
         }
      
         @Override
         protected void createCacheManagers() {
            ConfigurationBuilder c = buildConfiguration();
            createCluster(c, 3);
            waitForClusterToForm();
         }
      
         private ConfigurationBuilder buildConfiguration() {
            ConfigurationBuilder c = getDefaultClusteredCacheConfig(CacheMode.DIST_SYNC, false); //unreproducible with CacheMode.REPL_SYNC
            c.clustering().hash().numOwners(2);
            return c;
         }
      
         public void testJoins() {
            cache(0).addListener(new NoOpListener());
      
            addClusterEnabledCacheManager(buildConfiguration());
            //waitForClusterToForm();
      
            cache(0).addListener(new NoOpListener());  //fails most times with SuspectException; uncomment the line above to ensure it does not fail
         }
      }
      

              wburns@redhat.com Will Burns
              anistor Adrian Nistor (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: