[ 
https://issues.apache.org/jira/browse/MYRIAD-188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15177133#comment-15177133
 ] 

DarinJ edited comment on MYRIAD-188 at 3/3/16 2:56 PM:
-------------------------------------------------------

Changed setNodeCapacity in YarnNodeCapacity as below, fixed the problem once I 
fixed the Unit Tests I'll submit a patch.
  public void setNodeCapacity(RMNode rmNode, Resource newCapacity) {
    rmNode.getTotalCapability().setMemory(newCapacity.getMemory());
    rmNode.getTotalCapability().setVirtualCores(newCapacity.getVirtualCores());
    LOGGER.debug("Setting capacity for node {} to {}", rmNode.getHostName(), 
newCapacity);
    // updates the scheduler with the new capacity for the NM.
    // the event is handled by the scheduler asynchronously
    synchronized (yarnScheduler) {
      if (yarnScheduler.getSchedulerNode(rmNode.getNodeID()) != null) {
        rmContext.getDispatcher().getEventHandler().handle(new 
NodeResourceUpdateSchedulerEvent(rmNode,
             ResourceOption.newInstance(rmNode.getTotalCapability(),
             RMNode.OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT)));
      } else {
        LOGGER.info("Node {} doesn't exist in Scheduler", rmNode.getNode());
      }
    }
  }



was (Author: darinj):
Changed setNodeCapacity in YarnNodeCapacity as below, fixed the problem once I 
fixed the Unit Tests I'll submit a patch.
  public void setNodeCapacity(RMNode rmNode, Resource newCapacity) {
    rmNode.getTotalCapability().setMemory(newCapacity.getMemory());
    rmNode.getTotalCapability().setVirtualCores(newCapacity.getVirtualCores());
    LOGGER.debug("Setting capacity for node {} to {}", rmNode.getHostName(), 
newCapacity);
    // updates the scheduler with the new capacity for the NM.
    // the event is handled by the scheduler asynchronously
    synchronized (yarnScheduler) {
      if (yarnScheduler.getSchedulerNode(rmNode.getNodeID()) != null) {
        yarnScheduler.updateNodeResource(rmNode, 
ResourceOption.newInstance(newCapacity,
             RMNode.OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT));
        rmContext.getDispatcher().getEventHandler().handle(new 
NodeResourceUpdateSchedulerEvent(rmNode,
             ResourceOption.newInstance(rmNode.getTotalCapability(),
             RMNode.OVER_COMMIT_TIMEOUT_MILLIS_DEFAULT)));
      } else {
        LOGGER.info("Node {} doesn't exist in Scheduler", rmNode.getNode());
      }
    }
  }


> Zero sized node managers can cause the Resource Manager to crash with an NPE
> ----------------------------------------------------------------------------
>
>                 Key: MYRIAD-188
>                 URL: https://issues.apache.org/jira/browse/MYRIAD-188
>             Project: Myriad
>          Issue Type: Bug
>          Components: Scheduler
>    Affects Versions: Myriad 0.1.0
>            Reporter: DarinJ
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to