Github user GJL commented on a diff in the pull request: https://github.com/apache/flink/pull/6035#discussion_r189004536 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java --- @@ -1605,9 +1609,16 @@ public void notifyHeartbeatTimeout(final ResourceID resourceId) { runAsync(() -> { log.info("The heartbeat of ResourceManager with id {} timed out.", resourceId); - closeResourceManagerConnection( - new TimeoutException( - "The heartbeat of ResourceManager with id " + resourceId + " timed out.")); + if (establishedResourceManagerConnection != null && establishedResourceManagerConnection.getResourceManagerResourceID().equals(resourceId)) { + final String resourceManagerAddress = establishedResourceManagerConnection.getResourceManagerGateway().getAddress(); --- End diff -- Declaration and assignment can be moved closer to `createResourceManagerConnection`.
---