From 6307962b932e0ee69ba61f5796388c175d79195a Mon Sep 17 00:00:00 2001 From: Sunil G Date: Wed, 13 Jun 2018 16:09:16 +0530 Subject: [PATCH] YARN-8404. Timeline event publish need to be async to avoid Dispatcher thread leak in case ATS is down. Contributed by Rohith Sharma K S --- .../resourcemanager/metrics/TimelineServiceV1Publisher.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV1Publisher.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV1Publisher.java index 31b07f1d35..dc5292bdbf 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV1Publisher.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/metrics/TimelineServiceV1Publisher.java @@ -153,9 +153,9 @@ public void appFinished(RMApp app, RMAppState state, long finishedTime) { tEvent.setEventInfo(eventInfo); entity.addEvent(tEvent); - // sync sending of finish event to avoid possibility of saving application - // finished state in RMStateStore save without publishing in ATS. - putEntity(entity); // sync event so that ATS update is done without fail. + + getDispatcher().getEventHandler().handle(new TimelineV1PublishEvent( + SystemMetricsEventType.PUBLISH_ENTITY, entity, app.getApplicationId())); } @SuppressWarnings("unchecked")