Return-Path: X-Original-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-yarn-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6350210026 for ; Tue, 5 Nov 2013 06:16:23 +0000 (UTC) Received: (qmail 61129 invoked by uid 500); 5 Nov 2013 06:16:21 -0000 Delivered-To: apmail-hadoop-yarn-issues-archive@hadoop.apache.org Received: (qmail 61055 invoked by uid 500); 5 Nov 2013 06:16:19 -0000 Mailing-List: contact yarn-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: yarn-issues@hadoop.apache.org Delivered-To: mailing list yarn-issues@hadoop.apache.org Received: (qmail 61027 invoked by uid 99); 5 Nov 2013 06:16:18 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Nov 2013 06:16:18 +0000 Date: Tue, 5 Nov 2013 06:16:18 +0000 (UTC) From: "Bikas Saha (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-1121) RMStateStore should flush all pending store events before closing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/YARN-1121?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13813685#comment-13813685 ] Bikas Saha commented on YARN-1121: ---------------------------------- There are 3 new booleans with 8 combinations possible between them. Which combinations are legal? Which are impossible? Some comments will help understand their interaction. Naming could be better. e.g. drainEventsOnStop instead of drainingStopNeeded and drainOnStop instead of drainingStop. {code} + private volatile boolean drained = true; + private volatile boolean drainingStopNeeded = false; + private volatile boolean drainingStop = false; {code} Typo {code} + LOG.info("Ignoring events as AsyncDispatcher is draning to stop."); {code} Isnt this almost a tight loop? Given that storing stuff will be over the network and slow, why not have a wait notify between this thread and the draining thread? DrainEventHandler sounds misleading. It doesnt really drain. It ignores or drops events. The other thing we can do is take a count of the number of pending events to drain at service stop. Then make sure we drain only those many, thus ignoring the new ones. This removes the need of drainingStop and reduces the combinatorics of booleans. > RMStateStore should flush all pending store events before closing > ----------------------------------------------------------------- > > Key: YARN-1121 > URL: https://issues.apache.org/jira/browse/YARN-1121 > Project: Hadoop YARN > Issue Type: Sub-task > Components: resourcemanager > Affects Versions: 2.1.0-beta > Reporter: Bikas Saha > Assignee: Jian He > Fix For: 2.2.1 > > Attachments: YARN-1121.1.patch, YARN-1121.2.patch, YARN-1121.2.patch, YARN-1121.3.patch, YARN-1121.4.patch, YARN-1121.5.patch > > > on serviceStop it should wait for all internal pending events to drain before stopping. -- This message was sent by Atlassian JIRA (v6.1#6144)