In my application I am loading the buckets in application startup and its able to load up to 16 buckets but when it’s tried to connect 17th bucket getting below error.
Exception in thread "main" com.couchbase.client.core.error.UnambiguousTimeoutException: WaitUntilReady timed out {"bucket":"b12","checkedServices":[],"currentState":"ONLINE","desiredState":"ONLINE","services":{"kv":[{"last_activity_us":100650208,"namespace":"b1","state":"connected","id":"0xafc8437b","remote":"172.21.144.1:11210","local":"172.21.144.1:56641"},{"last_activity_us":100427826,"namespace":"b2","state":"connected","id":"0x458c10c6","remote":"172.21.144.1:11210","local":"172.21.144.1:56650"},{"last_activity_us":100373976,"namespace":"b3","state":"connected","id":"0x7e31c098","remote":"172.21.144.1:11210","local":"172.21.144.1:56652"},{"last_activity_us":100067368,"namespace":"b4","state":"connected","id":"0x472d1b42","remote":"172.21.144.1:11210","local":"172.21.144.1:56666"},{"last_activity_us":100517605,"namespace":"b5","state":"connected","id":"0x4f1a40ba","remote":"172.21.144.1:11210","local":"172.21.144.1:56646"},{"last_activity_us":100567578,"namespace":"b6","state":"connected","id":"0x8cd591af","remote":"172.21.144.1:11210","local":"172.21.144.1:56644"},{"last_activity_us":100476652,"namespace":"b7","state":"connected","id":"0x26d428a8","remote":"172.21.144.1:11210","local":"172.21.144.1:56648"},{"last_activity_us":100323750,"namespace":"b8","state":"connected","id":"0x757140a3","remote":"172.21.144.1:11210","local":"172.21.144.1:56655"},{"last_activity_us":100015132,"namespace":"b9","state":"connected","id":"0xbe4812f7","remote":"172.21.144.1:11210","local":"172.21.144.1:56669"},{"last_activity_us":100146117,"namespace":"b10","state":"connected","id":"0xe411a3a4","remote":"172.21.144.1:11210","local":"172.21.144.1:56662"},{"last_activity_us":100612407,"namespace":"b11","state":"connected","id":"0xb72cb85d","remote":"172.21.144.1:11210","local":"172.21.144.1:56642"},{"last_activity_us":19946869,"namespace":"b12","state":"connected","id":"0xefc06535","remote":"172.21.144.1:11210","local":"172.21.144.1:56670"},{"last_activity_us":1090447,"state":"connected","id":"0x17da3bdc","remote":"172.21.144.1:11210","local":"172.21.144.1:56632"},{"last_activity_us":100197351,"namespace":"b13","state":"connected","id":"0x84054f0b","remote":"172.21.144.1:11210","local":"172.21.144.1:56661"},{"last_activity_us":100107606,"namespace":"b14","state":"connected","id":"0x34b9a705","remote":"172.21.144.1:11210","local":"172.21.144.1:56664"},{"last_activity_us":100705915,"namespace":"b15","state":"connected","id":"0xf87ffed0","remote":"172.21.144.1:11210","local":"172.21.144.1:56633"},{"last_activity_us":100285015,"namespace":"b16","state":"connected","id":"0x6aae88f5","remote":"172.21.144.1:11210","local":"172.21.144.1:56656"},{"last_activity_us":100236539,"namespace":"b17","state":"connected","id":"0x21b368c8","remote":"172.21.144.1:11210","local":"172.21.144.1:56658"}],"mgmt":[{"last_activity_us":100717406,"state":"connected","id":"0x179ecc1d","remote":"172.21.144.1:8091","local":"172.21.144.1:56634"},{"state":"connected","id":"0x1b558098","remote":"172.21.144.1:8091","local":"172.21.144.1:56635"},{"last_activity_us":100016089,"state":"connected","id":"0x95a45d93","remote":"172.21.144.1:8091","local":"172.21.144.1:56638"},{"state":"connected","id":"0x9b8e9d6c","remote":"172.21.144.1:8091","local":"172.21.144.1:56643"},{"state":"connected","id":"0xf0671f79","remote":"172.21.144.1:8091","local":"172.21.144.1:56645"},{"state":"connected","id":"0xea93ce4e","remote":"172.21.144.1:8091","local":"172.21.144.1:56647"},{"state":"connected","id":"0x8a188b23","remote":"172.21.144.1:8091","local":"172.21.144.1:56649"},{"state":"connected","id":"0x99be0085","remote":"172.21.144.1:8091","local":"172.21.144.1:56651"},{"state":"connected","id":"0xe357e6d1","remote":"172.21.144.1:8091","local":"172.21.144.1:56653"},{"state":"connected","id":"0x3bcb177e","remote":"172.21.144.1:8091","local":"172.21.144.1:56654"},{"state":"connected","id":"0x16b2c052","remote":"172.21.144.1:8091","local":"172.21.144.1:56657"},{"state":"connected","id":"0xf5e59ce3","remote":"172.21.144.1:8091","local":"172.21.144.1:56659"},{"state":"connected","id":"0xac65048f","remote":"172.21.144.1:8091","local":"172.21.144.1:56660"},{"state":"connected","id":"0x0a55a4e6","remote":"172.21.144.1:8091","local":"172.21.144.1:56663"},{"state":"connected","id":"0x0edd3712","remote":"172.21.144.1:8091","local":"172.21.144.1:56665"},{"state":"connected","id":"0x73aca808","remote":"172.21.144.1:8091","local":"172.21.144.1:56668"}]},"state":{"current_stage":"CONFIG_LOAD","current_stage_since_ms":100004,"timings_ms":{},"total_ms":100004},"timeoutMs":100000}
at com.couchbase.client.java.AsyncUtils.block(AsyncUtils.java:51)
at com.couchbase.client.java.Bucket.waitUntilReady(Bucket.java:229)
at poc.BucketInitialization.main(BucketInitialization.java:56)
Suppressed: java.lang.Exception: The above exception was originally thrown by another thread at the following location.
at com.couchbase.client.core.diagnostics.WaitUntilReadyHelper.lambda$waitUntilReady$9(WaitUntilReadyHelper.java:162)
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:44)
at reactor.core.publisher.Mono.subscribe(Mono.java:4397)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.handleTimeout(FluxTimeout.java:301)
at reactor.core.publisher.FluxTimeout$TimeoutMainSubscriber.doTimeout(FluxTimeout.java:280)
at reactor.core.publisher.FluxTimeout$TimeoutTimeoutSubscriber.onNext(FluxTimeout.java:419)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.propagateDelay(MonoDelay.java:271)
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.run(MonoDelay.java:286)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
some times getting below error instead above
Exception in thread "main" com.couchbase.client.core.error.UnambiguousTimeoutException: GenericManagerRequest, Reason: TIMEOUT {"cancelled":true,"completed":true,"coreId":"0xe55e9bd300000001","idempotent":true,"lastDispatchedTo":"172.21.144.1","reason":"TIMEOUT","requestId":116,"requestType":"GenericManagerRequest","retried":156,"retryReasons":["ENDPOINT_NOT_AVAILABLE"],"timeoutMs":75000}
at com.couchbase.client.java.AsyncUtils.block(AsyncUtils.java:51)
at com.couchbase.client.java.Bucket.waitUntilReady(Bucket.java:229)
at poc.BucketInitialization.main(BucketInitialization.java:56)
Suppressed: java.lang.Exception: The above exception was originally thrown by another thread at the following location.
at com.couchbase.client.core.msg.BaseRequest.cancel(BaseRequest.java:184)
at com.couchbase.client.core.msg.Request.cancel(Request.java:70)
at com.couchbase.client.core.Timer.lambda$register$2(Timer.java:157)
at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$HashedWheelTimeout.run(HashedWheelTimer.java:715)
at com.couchbase.client.core.deps.io.netty.util.concurrent.ImmediateExecutor.execute(ImmediateExecutor.java:34)
at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:703)
at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:790)
at com.couchbase.client.core.deps.io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:503)
at com.couchbase.client.core.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)
Below is my code
Cluster cluster = null;
Bucket bucket = null;
Map<String, Collection> collectionMap = new HashMap<>();
Set<SeedNode> seedNodes = new HashSet<>(Collections.singletonList(
SeedNode.create("172.21.144.1")
));
//KVTimeout: The Key/Value default timeout is used on operations which are performed on a specific key, Default: 2.5s
ClusterEnvironment env = ClusterEnvironment.builder()
.timeoutConfig(TimeoutConfig.kvTimeout(Duration.ofMillis(5000)).connectTimeout(Duration.ofMillis(20000)))
.build();
cluster = Cluster.connect(seedNodes, ClusterOptions.clusterOptions(username, password).environment(env));
List<String> bucketList = bucketList();
long totalTime = 0L;
for (String bucketName : bucketList) {
long startTime = System.currentTimeMillis();
bucket = cluster.bucket(bucketName);
// get a collection reference
Collection collection = bucket.defaultCollection();
bucket.waitUntilReady(Duration.ofSeconds(100));
collectionMap.put(bucketName, collection);
long timeTaken = System.currentTimeMillis() - startTime;
totalTime += timeTaken;
System.out.println("## Time taken to initialized the bucket:" + bucketName + " = " + timeTaken);
//Thread.sleep(1000);
}
System.out.println("### Average time:" + (totalTime/bucketList.size()) + " for no. of bucket:" + bucketList.size());
I have also tried for increase time for waitUntilReady however not working for me.
Using
Couchbase Java SDK version 3.3.4
Couchbase community server version couchbase-server-community-6.6.0-7909