Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-3976

Catch ApplicationNotFoundException instead of parent YarnException in YarnClient and AppReportFetcher

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Duplicate
    • 2.7.1
    • None
    • None
    • None

    Description

      It's is better to catch the ApplicationNotFoundException rather than the parent YarnException and rethrow it when it's not ApplicationNotFoundExcepton

       catch (YarnException e) {
            if (!historyServiceEnabled) {
              // Just throw it as usual if historyService is not enabled.
              throw e;
            }
            // Even if history-service is enabled, treat all exceptions still the same
            // except the following
            if (!(e.getClass() == ApplicationNotFoundException.class)) {
              throw e;
            }
      

      Attachments

        Issue Links

          Activity

            People

              mitdesai Mit Desai
              mitdesai Mit Desai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: