Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.11.0
    • Component/s: library
    • Security Level: Public
    • Labels:
      None

      Activity

      Hide
      daschl Michael Nitschinger added a comment -

      for reference, here is some test code to reproduce it:

      package com.couchbase.client;

      import net.spy.memcached.internal.BulkGetCompletionListener;
      import net.spy.memcached.internal.BulkGetFuture;
      import org.junit.Test;

      import java.net.URI;
      import java.util.ArrayList;
      import java.util.Arrays;
      import java.util.List;
      import java.util.concurrent.CountDownLatch;

      public class RebalanceTest {

      @Test
      public void foo() throws Exception {
      //String host = "127.0.0.1";
      String host = "192.168.56.101";
      CouchbaseClient c = new CouchbaseClient(
      Arrays.asList(URI.create("http://" + host + ":8091/pools")), "default", "");

      List<String> keys = new ArrayList<String>();
      for (int i = 0; i < 1000; i++)

      { String k = "key-" + i; c.set(k, "value").get(); keys.add(k); }

      while(true) {
      try {
      final CountDownLatch latch = new CountDownLatch(1);
      c.asyncGetBulk(keys).addListener(new BulkGetCompletionListener() {
      @Override
      public void onComplete(BulkGetFuture<?> future) throws Exception {
      if (future.get().size() != 1000)

      { System.out.println(future.get().size()); System.out.println(future.getStatus()); }

      latch.countDown();
      }
      });
      latch.await();
      } catch (Exception e)

      { e.printStackTrace(); }

      }
      }
      }

      Show
      daschl Michael Nitschinger added a comment - for reference, here is some test code to reproduce it: package com.couchbase.client; import net.spy.memcached.internal.BulkGetCompletionListener; import net.spy.memcached.internal.BulkGetFuture; import org.junit.Test; import java.net.URI; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.concurrent.CountDownLatch; public class RebalanceTest { @Test public void foo() throws Exception { //String host = "127.0.0.1"; String host = "192.168.56.101"; CouchbaseClient c = new CouchbaseClient( Arrays.asList(URI.create("http://" + host + ":8091/pools")), "default", ""); List<String> keys = new ArrayList<String>(); for (int i = 0; i < 1000; i++) { String k = "key-" + i; c.set(k, "value").get(); keys.add(k); } while(true) { try { final CountDownLatch latch = new CountDownLatch(1); c.asyncGetBulk(keys).addListener(new BulkGetCompletionListener() { @Override public void onComplete(BulkGetFuture<?> future) throws Exception { if (future.get().size() != 1000) { System.out.println(future.get().size()); System.out.println(future.getStatus()); } latch.countDown(); } }); latch.await(); } catch (Exception e) { e.printStackTrace(); } } } }

        People

        • Assignee:
          daschl Michael Nitschinger
          Reporter:
          daschl Michael Nitschinger
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Gerrit Reviews

            There are no open Gerrit changes