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

RMAppAttemptMetrics#getAggregateResourceUsage can NPE due to double lookup

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

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0
    • 3.0.0, 3.1.0
    • resourcemanager
    • None

    Description

      RMAppAttemptMetrics#getAggregateResourceUsage does a double-lookup on a concurrent hash map, but the app could be removed from the map between the two lookups:

          RMApp rmApp = rmContext.getRMApps().get(attemptId.getApplicationId());
          if (rmApp != null) {
            RMAppAttempt currentAttempt = rmContext.getRMApps().get(attemptId.getApplicationId()).getCurrentAppAttempt();
      

      The attempt should be looked up within rmApp directly rather than redundantly trying to retrieve the RMApp first.

      Attachments

        1. YARN-7454.001.patch
          2 kB
          Jason Darrell Lowe

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jlowe Jason Darrell Lowe
            jlowe Jason Darrell Lowe
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment