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

Catch ApplicationNotFoundException instead of parent YarnException in YarnClient and AppReportFetcher

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 2.7.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      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

            • Assignee:
              mitdesai Mit Desai
              Reporter:
              mitdesai Mit Desai

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment