提交 1a37dfdc 编写于 作者: C Christoph Hösler 提交者: Jihoon Son

Fetch unhandled curator exceptions (#6131)

* fix: stop druid on unhandled curator exceptions

* catch exceptions when stopping lifecycle
上级 b0805540
...@@ -91,6 +91,16 @@ public class CuratorModule implements Module ...@@ -91,6 +91,16 @@ public class CuratorModule implements Module
.aclProvider(config.getEnableAcl() ? new SecuredACLProvider() : new DefaultACLProvider()) .aclProvider(config.getEnableAcl() ? new SecuredACLProvider() : new DefaultACLProvider())
.build(); .build();
framework.getUnhandledErrorListenable().addListener((message, e) -> {
log.error(e, "Unhandled error in Curator Framework");
try {
lifecycle.stop();
}
catch (Throwable t) {
log.warn(t, "Exception when stopping druid lifecycle");
}
});
lifecycle.addHandler( lifecycle.addHandler(
new Lifecycle.Handler() new Lifecycle.Handler()
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册