5 Replies Latest reply on Jul 15, 2015 9:16 AM by Enrico Olivelli

    Help debugging NearCache and multiple HotRod server architecture

    Enrico Olivelli Newbie


      I'm running Infinispan 7.2.3Final and I'm in trouble with the nearcache.

      That fact is that when running a cluster with more than one server after some time (I'm not yet able to reproduce the problem systematically) all the Java HotRod Clients clients stop behaving correctly, that is, it reads "stale" values from Infinispan.

      This is the case, in the simplest staging environment which reproduces the problem:

      - two java hotrod clients

      - two java hotrod servers (embedded in a java application, which does nothing but hosting the Infinispan server)

      - the clients are configured to connected to all the servers


      the client follows these steps:

      - writes an entry to a cache, with value=A

      - updates the entry to the cache, with value=B

      - reads the entry from the cache, the returned value is A


      of course this does not happens always, most of the time Infinispan works as expected, but after some time that the system is fully running every client stops behaving as expected and the buggy beheaviur  starts.

      Even after restarting the server nodes the clients are not able to recover anymore, the only resolution is to restart the clients.


      Even putting  all the loggers at DEBUG level I cannot find any "exception", both on servers and on clients.


      Any idea of how can I debug this situation ?


      client side bootstrap code:

                  org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder().forceReturnValues(false);
























                              .callbackHandler(new SecurityCallbackHandler(username, password, realm));

                       for each server...{







      RemoteCacheManager remoteCacheManager = new RemoteCacheManager(clientBuilder.build());



      Server side configuration:

      GlobalConfiguration globalConfig = new GlobalConfigurationBuilder()







                          .addProperty("configurationFile", configurationFile)   // using default jgroups UDP multicast







                  Configuration wildcard = new ConfigurationBuilder()





                          .l1().lifespan(l1ttl).enabled(l1ttl > 0)                            // problems happens both with l1 that without l1









      EmbeddedCacheManager manager = new DefaultCacheManager(globalConfig, wildcard, false);

      HotRodServer hotrodserver =new HotRodServer();

      HotRodServerConfigurationBuilder configBuilder = new HotRodServerConfigurationBuilder()



      SimpleServerAuthenticationProvider authProv = new SimpleServerAuthenticationProvider();

      authProv.addUser(username, realm, password);