From yarn-issues-return-179586-archive-asf-public=cust-asf.ponee.io@hadoop.apache.org Tue Apr 21 06:34:04 2020 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 [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id CFB3F180661 for ; Tue, 21 Apr 2020 08:34:03 +0200 (CEST) Received: (qmail 72174 invoked by uid 500); 21 Apr 2020 06:34:02 -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 72053 invoked by uid 99); 21 Apr 2020 06:34:02 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2020 06:34:02 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 215C1E2ED7 for ; Tue, 21 Apr 2020 06:34:00 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 2376378043D for ; Tue, 21 Apr 2020 06:34:00 +0000 (UTC) Date: Tue, 21 Apr 2020 06:34:00 +0000 (UTC) From: "Prabhu Joseph (Jira)" To: yarn-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (YARN-10240) Prevent Fatal CancelledException in TimelineV2Client when stopping 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-10240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17088342#comment-17088342 ] Prabhu Joseph commented on YARN-10240: -------------------------------------- Have committed it to trunk. > Prevent Fatal CancelledException in TimelineV2Client when stopping > ------------------------------------------------------------------ > > Key: YARN-10240 > URL: https://issues.apache.org/jira/browse/YARN-10240 > Project: Hadoop YARN > Issue Type: Sub-task > Components: ATSv2 > Reporter: Tarun Parimi > Assignee: Tarun Parimi > Priority: Major > Attachments: YARN-10240.001.patch > > > When the timeline client is stopped, it will cancel all sync EntityHolders after waiting for a drain timeout. > {code:java} > // if some entities were not drained then we need interrupt > // the threads which had put sync EntityHolders to the queue. > EntitiesHolder nextEntityInTheQueue = null; > while ((nextEntityInTheQueue = > timelineEntityQueue.poll()) != null) { > nextEntityInTheQueue.cancel(true); > } > {code} > We only handle interrupted exception here. > {code:java} > if (sync) { > // In sync call we need to wait till its published and if any error then > // throw it back > try { > entitiesHolder.get(); > } catch (ExecutionException e) { > throw new YarnException("Failed while publishing entity", > e.getCause()); > } catch (InterruptedException e) { > Thread.currentThread().interrupt(); > throw new YarnException("Interrupted while publishing entity", e); > } > } > {code} > But calling nextEntityInTheQueue.cancel(true) will result in entitiesHolder.get() throwing a CancelledException which is not handled. This can result in FATAL error in NM. We need to prevent this. > {code:java} > FATAL event.AsyncDispatcher (AsyncDispatcher.java:dispatch(203)) - Error in dispatcher thread > java.util.concurrent.CancellationException > at java.util.concurrent.FutureTask.report(FutureTask.java:121) > at java.util.concurrent.FutureTask.get(FutureTask.java:192) > at org.apache.hadoop.yarn.client.api.impl.TimelineV2ClientImpl$TimelineEntityDispatcher.dispatchEntities(TimelineV2ClientImpl.java:545) > at org.apache.hadoop.yarn.client.api.impl.TimelineV2ClientImpl.putEntities(TimelineV2ClientImpl.java:149) > at org.apache.hadoop.yarn.server.nodemanager.timelineservice.NMTimelinePublisher.putEntity(NMTimelinePublisher.java:348) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: yarn-issues-unsubscribe@hadoop.apache.org For additional commands, e-mail: yarn-issues-help@hadoop.apache.org