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

Infinispan-Server stop working (hang) after hot rod remote command clean

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • None
    • 9.3.1.Final
    • Hot Rod
    • None
    • Hide
      • Start infinispan server
      • Add local cache 'test'

      run following code

      package test.cache;
      
      import org.infinispan.client.hotrod.RemoteCache;
      import org.infinispan.client.hotrod.RemoteCacheManager;
      import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated;
      import org.infinispan.client.hotrod.annotation.ClientCacheEntryModified;
      import org.infinispan.client.hotrod.annotation.ClientCacheEntryRemoved;
      import org.infinispan.client.hotrod.annotation.ClientListener;
      import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
      import org.infinispan.client.hotrod.event.ClientCacheEntryCreatedEvent;
      import org.infinispan.client.hotrod.event.ClientCacheEntryModifiedEvent;
      import org.infinispan.client.hotrod.event.ClientCacheEntryRemovedEvent;
      
      public class CacheListenerTest
      {
          public CacheListenerTest() throws Exception
          {
              ConfigurationBuilder builder = new ConfigurationBuilder();
              builder.addServer().host( "infinispan" ).port( 11222 );
              RemoteCacheManager cacheManager = new RemoteCacheManager( builder.build() );
              RemoteCache<String, Object> cache = cacheManager.getCache( "test" );
              for ( int i = 0; i < 100; i++ )
              {
                  SourceCacheListener sourceCacheListener = new SourceCacheListener();
                  cache.addClientListener( sourceCacheListener );
              }
              Thread.sleep( 2000 );
              for ( int i = 0; i < 10000; i++ )
              {
                  cache.put( "test" + i, "test" );
              }
              Thread.sleep( 2000 );
              System.out.println( "#### clear " );
              cache.clear();
              Thread.sleep( Long.MAX_VALUE );
              cacheManager.close();
          }
      
          public static void main( String[] args ) throws Exception
          {
              new CacheListenerTest();
          }
      
          @ClientListener
          public class SourceCacheListener
          {
              @ClientCacheEntryRemoved
              public void entryRemoved( ClientCacheEntryRemovedEvent<String> event )
              {
                  System.out.println( "#### remove " + event.getKey() );
              }
      
              @ClientCacheEntryCreated
              public void entryCreated( ClientCacheEntryCreatedEvent<String> event )
              {
                  System.out.println( "#### created " + event.getKey() );
              }
      
              @ClientCacheEntryModified
              public void entryModified( ClientCacheEntryModifiedEvent<String> event )
              {
                  System.out.println( "#### modified " + event.getKey() );
              }
          }
      }
      
      Show
      Start infinispan server Add local cache 'test' run following code package test.cache; import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCacheManager; import org.infinispan.client.hotrod.annotation.ClientCacheEntryCreated; import org.infinispan.client.hotrod.annotation.ClientCacheEntryModified; import org.infinispan.client.hotrod.annotation.ClientCacheEntryRemoved; import org.infinispan.client.hotrod.annotation.ClientListener; import org.infinispan.client.hotrod.configuration.ConfigurationBuilder; import org.infinispan.client.hotrod.event.ClientCacheEntryCreatedEvent; import org.infinispan.client.hotrod.event.ClientCacheEntryModifiedEvent; import org.infinispan.client.hotrod.event.ClientCacheEntryRemovedEvent; public class CacheListenerTest { public CacheListenerTest() throws Exception { ConfigurationBuilder builder = new ConfigurationBuilder(); builder.addServer().host( "infinispan" ).port( 11222 ); RemoteCacheManager cacheManager = new RemoteCacheManager( builder.build() ); RemoteCache< String , Object > cache = cacheManager.getCache( "test" ); for ( int i = 0; i < 100; i++ ) { SourceCacheListener sourceCacheListener = new SourceCacheListener(); cache.addClientListener( sourceCacheListener ); } Thread .sleep( 2000 ); for ( int i = 0; i < 10000; i++ ) { cache.put( "test" + i, "test" ); } Thread .sleep( 2000 ); System .out.println( "#### clear " ); cache.clear(); Thread .sleep( Long .MAX_VALUE ); cacheManager.close(); } public static void main( String [] args ) throws Exception { new CacheListenerTest(); } @ClientListener public class SourceCacheListener { @ClientCacheEntryRemoved public void entryRemoved( ClientCacheEntryRemovedEvent< String > event ) { System .out.println( "#### remove " + event.getKey() ); } @ClientCacheEntryCreated public void entryCreated( ClientCacheEntryCreatedEvent< String > event ) { System .out.println( "#### created " + event.getKey() ); } @ClientCacheEntryModified public void entryModified( ClientCacheEntryModifiedEvent< String > event ) { System .out.println( "#### modified " + event.getKey() ); } } }

      After some time (2days) the Hot-Rod-Server hang.
      The session beans (Wildfly) get SocketTimeOutExceptions when the won't to write to the cache
      Normally one cache ist dead without hot rod eventing and with locks>0.
      The ThreadDump shows many threads waiting for ClientEvent dispatching.
      It is not possible to shutdown the infinispan server (Only kill helps).

      After some research we found the following thread
      https://developer.jboss.org/thread/269005

      We have the same problem and change the queue size in the class
      org.infinispan.server.hotrod.ClientListenerRegistry (line 304)
      to 100000

      I don't understand why the queue is blocking?

            Unassigned Unassigned
            michaelsausmikat-1 Michael Sausmikat (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: