From 919c0802fa397647466c8554e96baa0e23823b02 Mon Sep 17 00:00:00 2001 From: Li Lu Date: Thu, 29 Sep 2016 15:41:31 -0700 Subject: [PATCH] YARN-4205. Addendum patch to fix branch-2. --- .../resourcemanager/rmapp/monitor/RMAppLifetimeMonitor.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/monitor/RMAppLifetimeMonitor.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/monitor/RMAppLifetimeMonitor.java index e550c972ae4..19a2c7bd419 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/monitor/RMAppLifetimeMonitor.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmapp/monitor/RMAppLifetimeMonitor.java @@ -100,7 +100,10 @@ public class RMAppLifetimeMonitor ApplicationTimeoutType timeoutType, long monitorStartTime, long timeout) { RMAppToMonitor appToMonitor = new RMAppToMonitor(appId, timeoutType); register(appToMonitor, monitorStartTime); - monitoredApps.putIfAbsent(appToMonitor, timeout); + Long oldTimeout = monitoredApps.get(appToMonitor); + if (oldTimeout == null) { + monitoredApps.put(appToMonitor, timeout); + } } @Override