etcd4j icon indicating copy to clipboard operation
etcd4j copied to clipboard

Hangs on waitForChange if connection breaks

Open BalogAbel opened this issue 8 years ago • 2 comments

Hy!

Is there any way to get notified if the connection to the etcd server dies during a waitForChange?

Sample code:

try {
	EtcdClient etcdClient = new EtcdClient(URI.create(System.getenv("etcd1.local")))
	EtcdResponsePromise<EtcdKeysResponse> request = etcdClient.getDir("testDir").recursive().waitForChange().send();
	request.addListener(promise -> {
	    //it is not executed if I kill the etcd server 
	  
	});
} catch (Exception e) {
	//it is not executed if I kill the etcd server
}

BalogAbel avatar Dec 01 '16 13:12 BalogAbel

etcd4j version 2.12.0 is broken. please make sure to use 2.11.0

sheinbergon avatar Dec 13 '16 15:12 sheinbergon

etcd4j 2.13.0 has been released, should be available soon on maven central.

@Bumper03 do you mind testing against the latest version and by setting a retry handle that stops after a number of re-connection attempts ?

lburgazzoli avatar Jan 13 '17 10:01 lburgazzoli