I am getting timeout exception from couchbase java sdk , Exception is as below:
java.lang.RuntimeException: java.util.concurrent.TimeoutException
at com.couchbase.client.java.util.Blocking.blockForSingle(Blocking.java:93)
at com.couchbase.client.java.CouchbaseBucket.get(CouchbaseBucket.java:119)
at com.couchbase.client.java.CouchbaseBucket.get(CouchbaseBucket.java:114)
at com.mmt.cache.dao.impl.CouchbaseDaoImpl.singleGetFromCouchBase(CouchbaseDaoImpl.java:60)
at com.mmt.cache.transformation.delegator.impl.CouchBaseServiceDelegatorImpl.put(CouchBaseServiceDelegatorImpl.java:112)
at com.mmt.cache.core.AbstractCacheService.putUsingCouchBaseDelegator(AbstractCacheService.java:122)
at com.mmt.cache.core.impl.SimpleCacheService.put(SimpleCacheService.java:55)
at com.mmt.cache.batching.service.impl.MultiPutBatchServiceImpl$1.run(MultiPutBatchServiceImpl.java:84)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.util.concurrent.TimeoutException
… 13 more
Code where I am getting this exception is :
public String singleGetFromCouchBase(String key) {
String value = null;
StringDocument stringDocument = bucket.get(key, StringDocument.class);
if(stringDocument != null){
value = stringDocument.content();
}
return value;
}
Thanks, we are using java-client-2.1.1 and our server version is : Version: 3.0.2-1603 Enterprise Edition (build-1603)
Please find the stack trace below:
http-80-1 2015-04-01 16:46:38 DEBUG CacheController:9 - put request successfully queued through Batch
pool-1-thread-1 2015-04-01 16:46:44 DEBUG CouchManager:9 - Couchbase Client = Stats CouchBaseBucket[BharatTest]
java.lang.RuntimeException: java.util.concurrent.TimeoutException
at com.couchbase.client.java.util.Blocking.blockForSingle(Blocking.java:93)
at com.couchbase.client.java.CouchbaseBucket.get(CouchbaseBucket.java:119)
at com.couchbase.client.java.CouchbaseBucket.get(CouchbaseBucket.java:114)
at com.mmt.cache.dao.impl.AbstractCouchBaseDaoImpl.getTTLFromCouchbase(AbstractCouchBaseDaoImpl.java:74)
at com.mmt.cache.core.AbstractCacheService.setDataScienceParameters(AbstractCacheService.java:55)
at com.mmt.cache.core.impl.SimpleCacheService.put(SimpleCacheService.java:54)
at com.mmt.cache.batching.service.impl.MultiPutBatchServiceImpl$1.run(MultiPutBatchServiceImpl.java:84)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.util.concurrent.TimeoutException
… 12 more
and see if it works? If so, 2.1.2 will be released soon. Alternatively you can try 2.1.0 since if that fixes it it was a regression introduced in 2.1.1.
@kscer timeouts are a very generic thing and heavily environment dependent. can you share some more information on your exact use case and stack trace with the issue?
Also, 2.1.5 is quite old by now, can you please upgrade to 2.3.6 and see if the issue persists? (2.1.x is not supported anymore, upgrading should be very painless)