Skip to content

Optimize zookeeper block logic on app startup#790

Merged
chickenlj merged 5 commits intoapache:masterfrom
chickenlj:bugfix_zookeeper_block
Oct 31, 2017
Merged

Optimize zookeeper block logic on app startup#790
chickenlj merged 5 commits intoapache:masterfrom
chickenlj:bugfix_zookeeper_block

Conversation

@chickenlj
Copy link
Copy Markdown
Contributor

No description provided.

throw new NullPointerException("Both Runnable and Executor can not be null!");
}
if (executor == null) {
executor = DEFAULT_EXECUTOR;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这个地方与之前的行为不一致,建议是传参数的时候,显示的传递 DEFAULT_EXECUTOR

}
started = true;
} else {
throw new IllegalStateException("Zkclient has already been started!");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

重复初始化直接跳过应该会比较好一些

client = listenableFutureTask.get();
client.subscribeStateChanges(listener);
} catch (InterruptedException e) {
e.printStackTrace();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这个地方要用 logger 输出

@chickenlj
Copy link
Copy Markdown
Contributor Author

已修正 @qinliujie

@chickenlj chickenlj merged commit 74ff1b6 into apache:master Oct 31, 2017
rolandhe pushed a commit to rolandhe/dubbo that referenced this pull request Sep 9, 2019
Optimize zookeeper block logic on app startup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants