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

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

    XMLWordPrintableJSON

Details

    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-16-35-27-550.png
          47 kB
          chenzihao
        2. image-2022-03-25-16-35-39-531.png
          148 kB
          chenzihao
        3. image-2022-03-25-16-35-46-528.png
          256 kB
          chenzihao

        Activity

          People

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

            Dates

              Created:
              Updated: