From yarn-issues-return-160725-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Mon Jan 7 04:45:06 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 49A8B180676 for ; Mon, 7 Jan 2019 04:45:06 +0100 (CET) Received: (qmail 82687 invoked by uid 500); 7 Jan 2019 03:45:05 -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 82419 invoked by uid 99); 7 Jan 2019 03:45:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Jan 2019 03:45:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 8BCDEC966C for ; Mon, 7 Jan 2019 03:45:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.301 X-Spam-Level: X-Spam-Status: No, score=-110.301 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id qqUbg-Uilszr for ; Mon, 7 Jan 2019 03:45:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 875F260E29 for ; Mon, 7 Jan 2019 03:45:02 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 0093EE2645 for ; Mon, 7 Jan 2019 03:45:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id BF5AD2555B for ; Mon, 7 Jan 2019 03:45:00 +0000 (UTC) Date: Mon, 7 Jan 2019 03:45:00 +0000 (UTC) From: "Hu Ziqian (JIRA)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-9163) Deadlock when use yarn rmadmin -refreshQueues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/YARN-9163?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D16735= 426#comment-16735426 ]=20 Hu Ziqian commented on YARN-9163: --------------------------------- [~Tao Yang]=EF=BC=8C Sorry, not found any new evidence yet. > Deadlock when use yarn rmadmin -refreshQueues > --------------------------------------------- > > Key: YARN-9163 > URL: https://issues.apache.org/jira/browse/YARN-9163 > Project: Hadoop YARN > Issue Type: Bug > Affects Versions: 3.1.1 > Reporter: Hu Ziqian > Assignee: Hu Ziqian > Priority: Blocker > Attachments: YARN-9163.001.patch, rm.jstack.ziqian.log > > > We have a cluster with 4000+ node and 10w+ app per-day in our=C2=A0produc= tion environment. When we use CLI: yarn rmadmin -refreshQueues, the active = rm's process is stuck and ha doesn't happen, which means all the cluster st= ops service and we can only fix it by reboot active rm. We can reproduce on= our production cluster every time but can't reproduce in our test environm= ent which only has 100+ nodes and few apps. Both of our production and test= environment use CapacityScheduler which open asyncSchedule function and pr= eemption > Analyzing the jstack of active rm, we found a dead lock in it: > thread one=EF=BC=88=C2=A0refreshqueue thread=EF=BC=89=EF=BC=9A > * take write lock of capacity scheduler > * take write lock of preemptionManager=C2=A0 > * wait read lock of root queue > thread two (asyncScheduleThread)=C2=A0=C2=A0 > * take read lock of root queue > * wait write lock of PreemptionManager > thread three (ipc handler on 8030 which deal the allocate ) > * wait write lock of root queue > These three thread work with a dead lock. > =C2=A0 > The deadlock=C2=A0happens because of a "bug" of=C2=A0ReadWriteLock: write= Lock request blocks future readLock despite policy unfair([https://bugs.ope= njdk.java.net/browse/JDK-6893626).]=C2=A0In order to solve this problem, we= change the logic of=C2=A0 refreshqueue thread, get a queue info copy first= and avoid the thread to take=C2=A0write lock of preemptionManager=C2=A0 an= d=C2=A0read lock of root queue at the same time. > =C2=A0 > We test our new code in our production environment and the refresh queue = command works well. > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org