Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dubbo-2187] Use CompletetableFuture to rewrite the embedded ListenableFuture #2213

Merged
merged 15 commits into from
Aug 13, 2018
Prev Previous commit
Next Next commit
deal exception
  • Loading branch information
dengwanghua committed Aug 9, 2018
commit 6b87f4449cc98daa0e3253a273c57ba9ebdf5b9c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ public void start() {

public void addListener(final IZkStateListener listener) {
completableFuture.whenComplete((v,e)->{
if (e instanceof InterruptedException) {
logger.warn(Thread.currentThread().getName() + " was interrupted unexpectedly, which may cause unpredictable exception!");
return;
}
if(e instanceof ExecutionException) {
logger.error("Got an exception when trying to create zkclient instance, can not connect to zookeeper server, please check!", e);
return;
}
client = v;
client.subscribeStateChanges(listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should handle the possible Exceptions that may come up here.


Expand Down