Github user uce commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2910#discussion_r90237601
  
    --- Diff: 
flink-runtime/src/main/scala/org/apache/flink/runtime/jobmanager/JobManager.scala
 ---
    @@ -505,37 +507,31 @@ class JobManager(
                 }
               }
             } catch {
    -          case t: Throwable => log.error(s"Failed to recover job $jobId.", 
t)
    +          case t: Throwable => log.warn(s"Failed to recover job $jobId.", 
t)
             }
           }(context.dispatcher)
     
         case RecoverAllJobs =>
           future {
    -        try {
    -          // The ActorRef, which is part of the submitted job graph can 
only be
    -          // de-serialized in the scope of an actor system.
    -          akka.serialization.JavaSerializer.currentSystem.withValue(
    -            context.system.asInstanceOf[ExtendedActorSystem]) {
    +        log.info("Attempting to recover all jobs.")
     
    -            log.info(s"Attempting to recover all jobs.")
    -
    -            val jobGraphs = submittedJobGraphs.recoverJobGraphs().asScala
    +        try {
    +          val jobIdsToRecover = submittedJobGraphs.getJobIds().asScala
     
    -            if (!leaderElectionService.hasLeadership()) {
    -              // we've lost leadership. mission: abort.
    -              log.warn(s"Lost leadership during recovery. Aborting 
recovery of ${jobGraphs.size} " +
    -                s"jobs.")
    -            } else {
    -              log.info(s"Re-submitting ${jobGraphs.size} job graphs.")
    +          if (jobIdsToRecover.isEmpty) {
    +            log.info("There are no jobs to recover.")
    +          } else {
    +            log.info(s"There are ${jobIdsToRecover.size} jobs to recover. 
Starting the job " +
    --- End diff --
    
    Should we do a `if-else` on the log level here and print the job IDs on 
debug?
    ```
    if (isDebug()) {
      // There are ${jobIdsToRecover.size} jobs to recover: [jobID]
    } else {
      // What you already have
    }
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to