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

VotersStop watchingWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      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

            • Assignee:
              pbacsko Peter Bacsko
              Reporter:
              pbacsko Peter Bacsko

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment