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

RMAppAttemptMetrics#getAggregateResourceUsage can NPE due to double lookup

    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

            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: