hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject hadoop git commit: HADOOP-12313. NPE in JvmPauseMonitor when calling stop() before start(). Contributed by Gabor Liptak.
Date Mon, 23 Nov 2015 07:09:35 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 c07fab5f6 -> f826195ee


HADOOP-12313. NPE in JvmPauseMonitor when calling stop() before start(). Contributed by Gabor
Liptak.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/f826195e
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/f826195e
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/f826195e

Branch: refs/heads/branch-2
Commit: f826195ee541a6fce8d287ad1a49400ff2128c09
Parents: c07fab5
Author: Haohui Mai <wheat9@apache.org>
Authored: Sun Nov 22 23:07:43 2015 -0800
Committer: Haohui Mai <wheat9@apache.org>
Committed: Sun Nov 22 23:07:51 2015 -0800

----------------------------------------------------------------------
 hadoop-common-project/hadoop-common/CHANGES.txt              | 3 +++
 .../main/java/org/apache/hadoop/util/JvmPauseMonitor.java    | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f826195e/hadoop-common-project/hadoop-common/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt
index 3b54c23..90c1ee8 100644
--- a/hadoop-common-project/hadoop-common/CHANGES.txt
+++ b/hadoop-common-project/hadoop-common/CHANGES.txt
@@ -839,6 +839,9 @@ Release 2.8.0 - UNRELEASED
     HADOOP-11677. Add cookie flags for logs and static contexts.
     (nijel via wheat9)
 
+    HADOOP-12313. NPE in JvmPauseMonitor when calling stop() before start().
+    (Gabor Liptak via wheat9)
+
 Release 2.7.3 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/f826195e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JvmPauseMonitor.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JvmPauseMonitor.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JvmPauseMonitor.java
index cd5afc6..73d7309 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JvmPauseMonitor.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/JvmPauseMonitor.java
@@ -78,12 +78,16 @@ public class JvmPauseMonitor {
     Preconditions.checkState(monitorThread == null,
         "Already started");
     monitorThread = new Daemon(new Monitor());
-    monitorThread.start();
+    if (shouldRun) {
+      monitorThread.start();
+    } else {
+      LOG.warn("stop() was called before start() completed");
+    }
   }
   
   public void stop() {
     shouldRun = false;
-    if (monitorThread != null) {
+    if (isStarted()) {
       monitorThread.interrupt();
       try {
         monitorThread.join();


Mime
View raw message