Aitozi commented on a change in pull request #17053:
URL: https://github.com/apache/flink/pull/17053#discussion_r699742772
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/util/ZooKeeperUtils.java
##########
@@ -226,9 +230,21 @@ public static CuratorFramework
startCuratorFramework(Configuration configuration
}
CuratorFramework cf = curatorFrameworkBuilder.build();
-
+ // This handler is only used to handle the error during start phase,
and should be
+ // removed after start curator success.
+ UnhandledErrorListener unhandledErrorListener =
+ (message, throwable) -> {
+ LOG.error(
+ "Exiting process for unhandled error in start
curator framework, "
+ + "error message: {}, exiting code: {}",
+ message,
+ ZOOKEEPER_FAILURE_EXIT_CODE,
+ throwable);
+ System.exit(ZOOKEEPER_FAILURE_EXIT_CODE);
+ };
+ cf.getUnhandledErrorListenable().addListener(unhandledErrorListener);
Review comment:
I don't really get your meaning, may be it's `should only` ?
I think we could safely remove the listener in `leaderElectionDriver` and
`leaderRetrievalDriver` like you said that,all the three handlers always exit
the process now, after one execute other will not be executed. So there is no
meaning to register other handlers.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]