Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CCACE200BA6 for ; Tue, 13 Sep 2016 02:23:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C7C01160AC8; Tue, 13 Sep 2016 00:23:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2407D160AD7 for ; Tue, 13 Sep 2016 02:23:21 +0200 (CEST) Received: (qmail 69223 invoked by uid 500); 13 Sep 2016 00:23:21 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 68745 invoked by uid 99); 13 Sep 2016 00:23:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2016 00:23:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id CCC882C1B7F for ; Tue, 13 Sep 2016 00:23:20 +0000 (UTC) Date: Tue, 13 Sep 2016 00:23:20 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-5605) Preempt containers (all on one node) to meet the requirement of starved applications MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 13 Sep 2016 00:23:23 -0000 [ https://issues.apache.org/jira/browse/YARN-5605?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15485753#comment-15485753 ] ASF GitHub Bot commented on YARN-5605: -------------------------------------- Github user kambatla commented on a diff in the pull request: https://github.com/apache/hadoop/pull/124#discussion_r78478634 --- Diff: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/fair/FSLeafQueue.java --- @@ -557,28 +599,33 @@ private boolean preemptContainerPreCheck() { getFairShare()); } - /** - * Is a queue being starved for its min share. - */ - @VisibleForTesting - boolean isStarvedForMinShare() { - return isStarved(getMinShare()); + private Resource minShareStarvation() { + Resource desiredShare = Resources.min(policy.getResourceCalculator(), + scheduler.getClusterResource(), getMinShare(), getDemand()); + + Resource starvation = Resources.subtract(desiredShare, getResourceUsage()); + boolean starved = Resources.greaterThan(policy.getResourceCalculator(), + scheduler.getClusterResource(), starvation, none()); + + long now = scheduler.getClock().getTime(); + if (!starved) { + setLastTimeAtMinShare(now); + } + + if (starved && + (now - lastTimeAtMinShare > getMinSharePreemptionTimeout())) { + return starvation; + } else { + return Resources.clone(Resources.none()); --- End diff -- Actually, this can be simplified further. Improvement in updated patch. > Preempt containers (all on one node) to meet the requirement of starved applications > ------------------------------------------------------------------------------------ > > Key: YARN-5605 > URL: https://issues.apache.org/jira/browse/YARN-5605 > Project: Hadoop YARN > Issue Type: Sub-task > Components: fairscheduler > Reporter: Karthik Kambatla > Assignee: Karthik Kambatla > Attachments: yarn-5605-1.patch, yarn-5605-2.patch > > > Required items: > # Identify starved applications > # Identify a node that has enough containers from applications over their fairshare. > # Preempt those containers -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org