hadoop-yarn-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (YARN-5829) FS preemption should reserve a node before considering containers on it for preemption
Date Sat, 25 Mar 2017 01:39:41 GMT

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

ASF GitHub Bot commented on YARN-5829:
--------------------------------------

Github user szegedim commented on a diff in the pull request:

    https://github.com/apache/hadoop/pull/201#discussion_r108024779
  
    --- Diff: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSSchedulerNode.java
---
    @@ -110,16 +149,57 @@ synchronized FSAppAttempt getReservedAppSchedulable() {
       }
     
       /**
    +   * List reserved resources after preemption and assign them to the
    +   * appropriate applications in a FIFO order.
    +   * It is a good practice to call {@link #cleanupPreemptionList()}
    +   * after this call
    +   * @return if any resources were allocated
    +   */
    +  synchronized LinkedHashMap<FSAppAttempt, Resource> getPreemptionList() {
    +    cleanupPreemptionList();
    +    return new LinkedHashMap<>(resourcesPreemptedForApp);
    +  }
    +
    +  /**
    +   * Remove apps that have their preemption requests fulfilled
    +   */
    +  synchronized void cleanupPreemptionList() {
    +    Iterator<FSAppAttempt> iterator =
    +        resourcesPreemptedForApp.keySet().iterator();
    +    while (iterator.hasNext()) {
    +      FSAppAttempt app = iterator.next();
    +      boolean removeApp = false;
    +      if (app.isStopped() || Resources.equals(
    +          app.getPendingDemand(), Resources.none())) {
    +        // App does not need more resources
    +        Resources.subtractFrom(totalResourcesPreempted,
    +            resourcesPreemptedForApp.get(app));
    +        iterator.remove();
    +      }
    +    }
    +  }
    +
    +  /**
        * Mark {@code containers} as being considered for preemption so they are
        * not considered again. A call to this requires a corresponding call to
    -   * {@link #removeContainerForPreemption} to ensure we do not mark a
    +   * removeContainer for preemption to ensure we do not mark a
    --- End diff --
    
    Fixed.


> FS preemption should reserve a node before considering containers on it for preemption
> --------------------------------------------------------------------------------------
>
>                 Key: YARN-5829
>                 URL: https://issues.apache.org/jira/browse/YARN-5829
>             Project: Hadoop YARN
>          Issue Type: Sub-task
>          Components: fairscheduler
>            Reporter: Karthik Kambatla
>            Assignee: Miklos Szegedi
>
> FS preemption evaluates nodes for preemption, and subsequently preempts identified containers.
If this node is not reserved for a specific application, any other application could be allocated
resources on this node. 
> Reserving the node for the starved application before preempting containers would help
avoid this.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

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


Mime
View raw message