[ https://issues.apache.org/jira/browse/FLINK-6160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16479309#comment-16479309 ]
ASF GitHub Bot commented on FLINK-6160: --------------------------------------- Github user tillrohrmann commented on a diff in the pull request: https://github.com/apache/flink/pull/6035#discussion_r189019837 --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/TaskExecutor.java --- @@ -947,6 +964,36 @@ private void closeResourceManagerConnection(Exception cause) { resourceManagerConnection.close(); resourceManagerConnection = null; } + + startRegistrationTimeout(); + } + + private void startRegistrationTimeout() { + final Time maxRegistrationDuration = taskManagerConfiguration.getMaxRegistrationDuration(); + + if (maxRegistrationDuration != null) { + final UUID newRegistrationTimeoutId = UUID.randomUUID(); + currentRegistrationTimeoutId = newRegistrationTimeoutId; + scheduleRunAsync(() -> registrationTimeout(newRegistrationTimeoutId), maxRegistrationDuration); + } + } + + private void stopRegistrationTimeout() { + currentRegistrationTimeoutId = null; + } + + private void registrationTimeout(@Nonnull UUID registrationTimeoutId) { + if (registrationTimeoutId.equals(currentRegistrationTimeoutId)) { + final Time maxRegistrationDuration = taskManagerConfiguration.getMaxRegistrationDuration(); + + onFatalError( + new RegistrationTimeoutException( + String.format("Could not register at the ResourceManager within the specified maximum " + + "registration duration %s. This indicates a problem with this instance. Terminating now.", + maxRegistrationDuration))); + } else { + log.debug("Ignoring outdated registration timeout."); --- End diff -- True, will remove it. > Retry JobManager/ResourceManager connection in case of timeout > --------------------------------------------------------------- > > Key: FLINK-6160 > URL: https://issues.apache.org/jira/browse/FLINK-6160 > Project: Flink > Issue Type: Sub-task > Components: Distributed Coordination > Affects Versions: 1.3.0, 1.5.0, 1.6.0 > Reporter: Till Rohrmann > Assignee: Till Rohrmann > Priority: Blocker > Labels: flip-6 > Fix For: 1.5.0 > > > In case of a heartbeat timeout, the {{TaskExecutor}} closes the connection to > the remote component. Furthermore, it assumes that the component has actually > failed and, thus, it will only start trying to connect to the component if it > is notified about a new leader address and leader session id. This is > brittle, because the heartbeat could also time out without the component > having crashed. Thus, we should add an automatic retry to the latest known > leader address information in case of a timeout. > *Acceptance criteria:* > - The registration should be retried until a time limit expires after which > the {{TaskExecutor}} terminates. > - If the registration is declined ({{RegistrationResponse.Decline}}), the > {{TaskExecutor}} should terminate. -- This message was sent by Atlassian JIRA (v7.6.3#76005)