wangyang0918 commented on a change in pull request #14837:
URL: https://github.com/apache/flink/pull/14837#discussion_r571645895
##########
File path:
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/highavailability/KubernetesLeaderElectionDriver.java
##########
@@ -234,10 +245,21 @@ public void onError(List<KubernetesConfigMap> configMaps)
{
}
@Override
- public void handleFatalError(Throwable throwable) {
- fatalErrorHandler.onFatalError(
- new LeaderElectionException(
- "Error while watching the ConfigMap " +
configMapName, throwable));
+ public void handleError(Throwable throwable) {
+ if (throwable instanceof KubernetesTooOldResourceVersionException)
{
+ synchronized (watchLock) {
+ if (running) {
+ LOG.info("Creating a new watch on ConfigMap {}.",
configMapName);
+ kubernetesWatch =
Review comment:
After checking the fabric8 implementation, it is harmless to close the
watcher more than once. I could also add back the `kubernetesWatch.close`
before creating a new one.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]