mirror of https://github.com/apache/druid.git
Fetch unhandled curator exceptions (#6131)
* fix: stop druid on unhandled curator exceptions * catch exceptions when stopping lifecycle
This commit is contained in:
parent
b0805540af
commit
1a37dfdcd1
|
@ -91,6 +91,16 @@ public class CuratorModule implements Module
|
|||
.aclProvider(config.getEnableAcl() ? new SecuredACLProvider() : new DefaultACLProvider())
|
||||
.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(
|
||||
new Lifecycle.Handler()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue