Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-9698 [Umbrella] Tools to help migration from Fair Scheduler to Capacity Scheduler
  3. YARN-10191

FS-CS converter: call System.exit function call for every code path in main method

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 3.3.0
    • None
    • None
    • Reviewed

    Description

      Note that we don't call System.exit() on the happy path scenario in the converter:

        public static void main(String[] args) {
          try {
            FSConfigToCSConfigArgumentHandler fsConfigConversionArgumentHandler =
                new FSConfigToCSConfigArgumentHandler();
            int exitCode =
                fsConfigConversionArgumentHandler.parseAndConvert(args);
            if (exitCode != 0) {
              LOG.error(FATAL,
                  "Error while starting FS configuration conversion, " +
                      "see previous error messages for details!");
              System.exit(exitCode);
            }
          } catch (Throwable t) {
            LOG.error(FATAL,
                "Error while starting FS configuration conversion!", t);
            System.exit(-1);
          }
        }
       

      This is a mistake. If there's any non-daemon thread hanging around which was started by either FS or CS, the tool will never terminate. We must call System.exit() in every occasion to make sure that it never blocks at the end.

      Attachments

        1. YARN-10191-001.patch
          4 kB
          Peter Bacsko

        Activity

          People

            pbacsko Peter Bacsko
            pbacsko Peter Bacsko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: