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 7C2B5200BBB for ; Thu, 10 Nov 2016 15:19:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 7A8E0160B10; Thu, 10 Nov 2016 14:19:00 +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 C1F4A160AF6 for ; Thu, 10 Nov 2016 15:18:59 +0100 (CET) Received: (qmail 57660 invoked by uid 500); 10 Nov 2016 14:18:59 -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 57640 invoked by uid 99); 10 Nov 2016 14:18:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Nov 2016 14:18:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 959122C4C75 for ; Thu, 10 Nov 2016 14:18:58 +0000 (UTC) Date: Thu, 10 Nov 2016 14:18:58 +0000 (UTC) From: "Sunil G (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (YARN-5825) ProportionalPreemptionalPolicy could use readLock over LeafQueue instead of synchronized block MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 10 Nov 2016 14:19:00 -0000 [ https://issues.apache.org/jira/browse/YARN-5825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Sunil G updated YARN-5825: -------------------------- Attachment: YARN-5825.0001.patch Attaching an initial version of patch. In PCPP#cloneQueues, we use CSQueue abstract object. So I had to add {{getReadLock}} as an api in CSQueue interface to do lock. I agree this is not so clean way, however the alternative way is also not clean. We might need to add below code in PCPP if we want to remove {{getReadQueue}} from CSQueue interface {code} private ReentrantReadWriteLock.ReadLock getQueueReadLock(CSQueue curQueue) { if (curQueue instanceof ParentQueue) { return ((ParentQueue) curQueue).getReadLock(); } else if (curQueue instanceof LeafQueue) { return ((LeafQueue) curQueue).getReadLock(); } return null; } {code} [~leftnoteasy] thoughts? > ProportionalPreemptionalPolicy could use readLock over LeafQueue instead of synchronized block > ---------------------------------------------------------------------------------------------- > > Key: YARN-5825 > URL: https://issues.apache.org/jira/browse/YARN-5825 > Project: Hadoop YARN > Issue Type: Bug > Components: capacity scheduler > Reporter: Sunil G > Assignee: Sunil G > Attachments: YARN-5825.0001.patch > > > Currently in PCPP, {{synchronized (curQueue)}} is used in various places. Such instances could be replaced with a read lock. Thank you [~jianhe] for pointing out the same as comment [here|https://issues.apache.org/jira/browse/YARN-2009?focusedCommentId=15626578&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15626578] -- 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