hadoop-yarn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tao Yang (JIRA)" <j...@apache.org>
Subject [jira] [Created] (YARN-8233) NPE in CapacityScheduler#tryCommit when handling allocate/reserve proposal but its allocatedOrReservedContainer is null
Date Sat, 28 Apr 2018 07:09:00 GMT
Tao Yang created YARN-8233:

             Summary: NPE in CapacityScheduler#tryCommit when handling allocate/reserve proposal
but its allocatedOrReservedContainer is null
                 Key: YARN-8233
                 URL: https://issues.apache.org/jira/browse/YARN-8233
             Project: Hadoop YARN
          Issue Type: Bug
          Components: capacityscheduler
    Affects Versions: 3.2.0
            Reporter: Tao Yang
            Assignee: Tao Yang

Recently we saw a NPE problem in CapacityScheduler#tryCommit when try to find the attemptId
by calling {{c.getAllocatedOrReservedContainer().get...}} from an allocate/reserve proposal.
But got null allocatedOrReservedContainer and thrown NPE.
Reference code:
    // find the application to accept and apply the ResourceCommitRequest
    if (request.anythingAllocatedOrReserved()) {
      ContainerAllocationProposal<FiCaSchedulerApp, FiCaSchedulerNode> c =
      attemptId =
              .getApplicationAttemptId();   //NPE happens here
    } else { ...

The proposal was constructed in {{CapacityScheduler#createResourceCommitRequest}} and allocatedOrReservedContainer
is possibly null in async-scheduling process when node was lost or application was finished
(details in {{CapacityScheduler#getSchedulerContainer}}).
Reference code:
      // Allocated something
      List<AssignmentInformation.AssignmentDetails> allocations =
      if (!allocations.isEmpty()) {
        RMContainer rmContainer = allocations.get(0).rmContainer;
        allocated = new ContainerAllocationProposal<>(
            getSchedulerContainer(rmContainer, true),   //possibly null
                false), csAssignment.getType(),
            csAssignment.getSchedulingMode() != null ?
                csAssignment.getSchedulingMode() :

I think we should add null check for allocateOrReserveContainer before create allocate/reserve
proposals. Besides the allocation process has increase unconfirmed resource of app when creating
an allocate assignment, so if this check is null, we should decrease the unconfirmed resource
of live app.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: yarn-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-dev-help@hadoop.apache.org

View raw message