This is an automated email from the ASF dual-hosted git repository.

sumasai pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 2044967  YARN-9246 NPE when executing a command yarn node -status or 
-states without additional arguments. Contributed by Masahiro Tanaka
2044967 is described below

commit 2044967e7581f00c3f6378860426a69078faf694
Author: Suma Shivaprasad <[email protected]>
AuthorDate: Tue Feb 5 09:39:38 2019 -0800

    YARN-9246 NPE when executing a command yarn node -status or -states without 
additional arguments. Contributed by Masahiro Tanaka
---
 .../src/main/java/org/apache/hadoop/yarn/client/cli/YarnCLI.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/YarnCLI.java
 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/YarnCLI.java
index 0747b63..c1e02d5 100644
--- 
a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/YarnCLI.java
+++ 
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/main/java/org/apache/hadoop/yarn/client/cli/YarnCLI.java
@@ -72,6 +72,10 @@ public abstract class YarnCLI extends Configured implements 
Tool {
   }
 
   public void stop() {
-    this.client.stop();
+    // this.client may be null when it is called before
+    // invoking `createAndStartYarnClient`
+    if (this.client != null) {
+      this.client.stop();
+    }
   }
 }
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to