소스 검색

YARN-9246 NPE when executing a command yarn node -status or -states without additional arguments. Contributed by Masahiro Tanaka

Suma Shivaprasad 6 년 전
부모
커밋
2044967e75

+ 5 - 1
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();
+    }
   }
 }