Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-26859

Log cannot be printed completely when use System.exit(1)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Abandoned
    • 1.12.2
    • None
    • Deployment / YARN
    • None

    Description

      When I use Yarn-Application mode to submit Flink Job and there exist an exception expected, but I cannot get it in jobmanager log. And I only get the exit code 1 in yarn log.

      Relative code

      // YarnApplicationClusterEntryPoint#main
      try {
          program = getPackagedProgram(configuration);
      } catch (Exception e) {
          LOG.error("Could not create application program.", e);
          Thread.sleep(10); // add this for test
          System.exit(1);
      }
      

      Log info

      • The ERROR log doesn't exist before Thread.sleep.
      • The ERROR log exists after Thread.sleep.

      Reason

      System.exit() terminates the currently running Java Virtual Machine too fast to print the ERROR log.

      Improvement

      I think we can print the ERROR log to jobmanager.err before call System.exit(1) so that we can get the exception info.

      Attachments

        1. image-2022-03-25-15-43-11-310.png
          148 kB
          chenzihao
        2. image-2022-03-25-15-43-53-992.png
          256 kB
          chenzihao
        3. image-2022-03-25-15-46-44-935.png
          50 kB
          chenzihao

        Activity

          People

            Unassigned Unassigned
            chenzihao chenzihao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: