From ed20c59d36bc328c849b1dcc35511c6c5bda6b48 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 (cherry picked from commit 6307962b932e0ee69ba61f5796388c175d79195a) --- .../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 31b07f1d35a..dc5292bdbf9 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 class TimelineServiceV1Publisher extends AbstractSystemMetricsPublisher { 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")