Github user GJL commented on a diff in the pull request: https://github.com/apache/flink/pull/5312#discussion_r163160672 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorEndpoint.java --- @@ -144,6 +154,15 @@ public WebMonitorEndpoint( metricQueryServiceRetriever, executor, restConfiguration.getTimeout()); + + this.leaderElectionService = Preconditions.checkNotNull(leaderElectionService); + this.fatalErrorHandler = Preconditions.checkNotNull(fatalErrorHandler); + } + + @Override + public void start() throws Exception { + super.start(); + leaderElectionService.start(this); --- End diff -- Added ``` try { leaderElectionService.stop(); } catch (Exception e) { log.warn("Error while stopping leaderElectionService", e); } ``` to `shutdown` hook
---