Note that there are some explanatory texts on larger screens.

plurals
  1. POCouchbase: net.spy.memcached.internal.CheckedOperationTimeoutException
    primarykey
    data
    text
    <p>I'm loading local Couchbase instance with application specific json objects.</p> <p>Relevant code is:</p> <pre><code>CouchbaseClient getCouchbaseClient() { List&lt;URI&gt; uris = new LinkedList&lt;URI&gt;(); uris.add(URI.create("http://localhost:8091/pools")); CouchbaseConnectionFactoryBuilder cfb = new CouchbaseConnectionFactoryBuilder(); cfb.setFailureMode(FailureMode.Retry); cfb.setMaxReconnectDelay(1500); // to enqueue an operation cfb.setOpTimeout(10000); // wait up to 10 seconds for an operation to succeed cfb.setOpQueueMaxBlockTime(5000); // wait up to 5 seconds when trying to // enqueue an operation return new CouchbaseClient(cfb.buildCouchbaseConnection(uris, "my-app-bucket", "")); } </code></pre> <p>Method to store entry (I'm using suggestions from <a href="http://www.couchbase.com/docs/couchbase-sdk-java-1.0/java-sdk-bulk-load-and-backoff.html" rel="nofollow">Bulk Load and Exponential Backoff</a>):</p> <pre><code> void continuosSet(CouchbaseClient cache, String key, int exp, Object value, int tries) { OperationFuture&lt;Boolean&gt; result = null; OperationStatus status = null; int backoffexp = 0; do { if (backoffexp &gt; tries) { throw new RuntimeException(MessageFormat.format("Could not perform a set after {0} tries.", tries)); } result = cache.set(key, exp, value); try { if (result.get()) { break; } else { status = result.getStatus(); LOG.warn(MessageFormat.format("Set failed with status \"{0}\" ... retrying.", status.getMessage())); if (backoffexp &gt; 0) { double backoffMillis = Math.pow(2, backoffexp); backoffMillis = Math.min(1000, backoffMillis); // 1 sec max Thread.sleep((int) backoffMillis); LOG.warn("Backing off, tries so far: " + tries); } backoffexp++; } } catch (ExecutionException e) { LOG.error("ExecutionException while doing set: " + e.getMessage()); } catch (InterruptedException e) { LOG.error("InterruptedException while doing set: " + e.getMessage()); } } while (status != null &amp;&amp; status.getMessage() != null &amp;&amp; status.getMessage().indexOf("Temporary failure") &gt; -1); } </code></pre> <p>When continuosSet method called for a large amount of objects to store (single thread) e.g.</p> <pre><code>CouchbaseClient cache = getCouchbaseClient(); do { SerializableData data = queue.poll(); if (data != null) { final String key = data.getClass().getSimpleName() + data.getId(); continuosSet(cache, key, 0, gson.toJson(data, data.getClass()), 100); ... </code></pre> <p>it generates CheckedOperationTimeoutException inside of continuosSet method in result.get() operation.</p> <pre><code>Caused by: net.spy.memcached.internal.CheckedOperationTimeoutException: Timed out waiting for operation - failing node: 127.0.0.1/127.0.0.1:11210 at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:160) ~[spymemcached-2.8.12.jar:2.8.12] at net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:133) ~[spymemcached-2.8.12.jar:2.8.12] </code></pre> <p>Can someone shed light into this how to overcome and recover from this situation? Is there a good technique/workaround on how to bulk load in Java client for Couchbase? I already explored documentation <a href="http://www.couchbase.com/docs/couchbase-devguide-2.0/populating-cb.html" rel="nofollow">Performing a Bulk Set</a> which is unfortunately for PHP Couchbase client.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload