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

RMAppAttemptMetrics#getAggregateResourceUsage can NPE due to double lookup

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.0.0, 3.1.0
    • Component/s: resourcemanager
    • Labels:
      None
    • Target Version/s:

      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

          Issue Links

            Activity

              People

              • Assignee:
                jlowe Jason Lowe
                Reporter:
                jlowe Jason Lowe
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: