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

Nested async operations with HotRod client hang

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 9.4.10.Final
    • Hot Rod
    • None

    Description

      We noticed some issued with the HotRod client, when trying to use nested async calls. Originally, this was discovered in the context of Vert.x tests, but below you can find the smallest reproducer code that I could create (without any Vert.x dependencies).

      //DefaultCacheManager cm = new DefaultCacheManager();
              //Cache<String, String> cache =  cm.createCache("default",  new ConfigurationBuilder().build());
      
              RemoteCacheManager cm = new RemoteCacheManager();
              RemoteCache<String, String> cache = cm.getCache("default");
      
              final CompletableFuture put = new CompletableFuture();
              cache.putIfAbsentAsync("A", "A").thenAccept(resultA -> {
                  final CompletableFuture nested = new CompletableFuture();
                  cache.putIfAbsentAsync("B", "B").thenAccept(resultB -> {
                      nested.complete("B");
                  });
                  try {
                      nested.get();
                  } catch (Exception e) {
                      e.printStackTrace();
                  }
                  put.complete("B");
              });
      
              put.get();
      

      This would basically hang and the nested operation would never receive response. What I noticed in the original test is that response would become available after the framework timeout the test.

      Everything works as expected with embedded cache.

      Attachments

        Issue Links

          Activity

            People

              wburns@redhat.com Will Burns
              dejanbosanac Dejan Bosanac
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: