flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm <...@git.apache.org>
Subject [GitHub] flink pull request #2257: [FLINK-4152] Allow re-registration of TMs at resou...
Date Wed, 20 Jul 2016 13:30:27 GMT
Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2257#discussion_r71523881
  
    --- Diff: flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
---
    @@ -405,36 +405,23 @@ class JobManager(
     
           currentResourceManager match {
             case Some(rm) =>
    -          val future = (rm ? decorateMessage(new RegisterResource(taskManager, msg)))(timeout)
    -          future.onComplete {
    -            case scala.util.Success(response) =>
    -              // the resource manager is available and answered
    -              self ! response
    -            case scala.util.Failure(t) =>
    +          val future = (rm ? decorateMessage(new RegisterResource(msg)))(timeout)
    +          future.onFailure {
    +            case t: Throwable =>
                   t match {
                     case _: TimeoutException =>
                       log.info("Attempt to register resource at ResourceManager timed out.
Retrying")
                     case _ =>
                       log.warn("Failure while asking ResourceManager for RegisterResource.
Retrying", t)
                   }
    -              // slow or unreachable resource manager, register anyway and let the rm
reconnect
    -              self ! decorateMessage(new RegisterResourceSuccessful(taskManager, msg))
                   self ! decorateMessage(new ReconnectResourceManager(rm))
               }(context.dispatcher)
     
             case None =>
               log.info("Task Manager Registration but not connected to ResourceManager")
    -          // ResourceManager not yet available
    -          // sending task manager information later upon ResourceManager registration
    -          self ! decorateMessage(new RegisterResourceSuccessful(taskManager, msg))
           }
     
    -    case msg: RegisterResourceSuccessful =>
    -
    -      val originalMsg = msg.getRegistrationMessage
    -      val taskManager = msg.getTaskManager
    -
    -      // ResourceManager knows about the resource, now let's try to register TaskManager
    +      // ResourceManager is told about the resource, now let's try to register TaskManager
           if (instanceManager.isRegistered(taskManager)) {
    --- End diff --
    
    We could also add an additional message to remove registered resources (upon Disconnect
or Terminate). For most situations, the ResourceManager will probably detect a failed container
anyways.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message