zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject zeppelin git commit: Prevent NPE on delete local module cache
Date Thu, 20 Apr 2017 03:17:20 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master 7b585c739 -> 722ed8231


Prevent NPE on delete local module cache

### What is this PR for?
Prevent NPE on delete local module cache in HeliumBundleFactory

```
Caused by: java.lang.NullPointerException
	at org.apache.zeppelin.helium.HeliumBundleFactory.deleteYarnCache(HeliumBundleFactory.java:465)
	at org.apache.zeppelin.helium.HeliumBundleFactory.copyFrameworkModulesToInstallPath(HeliumBundleFactory.java:487)
	at org.apache.zeppelin.helium.HeliumBundleFactory.buildPackage(HeliumBundleFactory.java:403)
	at org.apache.zeppelin.helium.Helium.enable(Helium.java:314)
	at org.apache.zeppelin.rest.HeliumRestApi.enablePackage(HeliumRestApi.java:193)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
	at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96)
	... 50 more
```

### What type of PR is it?
Bug Fix

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: Lee moon soo <moon@apache.org>

Closes #2259 from Leemoonsoo/prevent_npe_helium_bundle_factory and squashes the following
commits:

0934af8 [Lee moon soo] Prevent NPE on delete local module cache


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

Branch: refs/heads/master
Commit: 722ed823193ed49d4e42ef17be2241cf6d48cd97
Parents: 7b585c7
Author: Lee moon soo <moon@apache.org>
Authored: Tue Apr 18 18:33:00 2017 -0700
Committer: Lee moon soo <moon@apache.org>
Committed: Wed Apr 19 20:17:17 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/zeppelin/helium/HeliumBundleFactory.java   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/722ed823/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
index 5bdb14c..bf2804e 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/helium/HeliumBundleFactory.java
@@ -462,8 +462,10 @@ public class HeliumBundleFactory {
     };
 
     File[] localModuleCaches = yarnCacheDir.listFiles(filter);
-    for (File f : localModuleCaches) {
-      FileUtils.deleteQuietly(f);
+    if (localModuleCaches != null) {
+      for (File f : localModuleCaches) {
+        FileUtils.deleteQuietly(f);
+      }
     }
   }
 


Mime
View raw message