You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by tillrohrmann <gi...@git.apache.org> on 2017/01/19 11:47:03 UTC

[GitHub] flink pull request #2974: [FLINK-5298] TM checks that log file exists

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

    https://github.com/apache/flink/pull/2974#discussion_r96843830
  
    --- Diff: flink-runtime/src/main/scala/org/apache/flink/runtime/taskmanager/TaskManager.scala ---
    @@ -830,19 +830,24 @@ class TaskManager(
               case StdOutFileRequest =>
                 new File(logFilePath.substring(0, logFilePath.length - 4) + ".out");
             }
    -        val fis = new FileInputStream(file);
    -        Future {
    -          val client: BlobClient = blobService.get.createClient()
    -          client.put(fis);
    -        }(context.dispatcher)
    -          .onComplete {
    -            case Success(value) => 
    -              sender ! value
    -              fis.close()
    -            case Failure(e) =>
    -              sender ! e
    -              fis.close()
    +        if (file.exists()) {
    +          val fis = new FileInputStream(file);
    +          Future {
    +            val client: BlobClient = blobService.get.createClient()
    +            client.put(fis);
               }(context.dispatcher)
    +            .onComplete {
    +              case Success(value) =>
    +                sender ! value
    +                fis.close()
    +              case Failure(e) =>
    +                sender ! e
    +                fis.close()
    +            }(context.dispatcher)
    +        } else {
    +          sender ! new IOException("TaskManager log files are unavailable. " +
    +            "Log file does not exist.")
    --- End diff --
    
    Maybe we could add the path under which we've looked for the log file to the error message.


---
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.
---