leventov commented on a change in pull request #6740: Zookeeper loss
URL: https://github.com/apache/incubator-druid/pull/6740#discussion_r246724425
##########
File path: server/src/main/java/org/apache/druid/curator/CuratorModule.java
##########
@@ -79,10 +80,24 @@ public CuratorFramework makeCurator(CuratorConfig config,
EnsembleProvider ensem
StringUtils.format("%s:%s", config.getZkUser(),
config.getZkPwd()).getBytes(StandardCharsets.UTF_8)
);
}
+
+ final Function<Void, Void> exitFunction = new Function<Void, Void>()
+ {
+ @Override
+ public Void apply(Void someVoid)
+ {
+ log.error("Zookeeper can't be reached, forcefully stopping
lifecycle...");
+ lifecycle.stop();
Review comment:
I think the reason of this should be understood. What if under some
conditions the other exit function configured in makeEnsembleProvider() will
suddenly kick in first and lifecycle will be left unfinished?
At very least, the exit function configured in `makeEnsembleProvider()`
should log that as such, to allow easier analysis later. And it should be
expressed in comments in that code that there are two functions configured
because nobody knows if the one configured in `makeCurator()` is sufficient.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]