You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by zj...@apache.org on 2020/09/01 14:16:37 UTC

[zeppelin] branch branch-0.9 updated: [ZEPPELIN-5022]. InterpreterSetting's status is not saved after downloading dependencies

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

zjffdu pushed a commit to branch branch-0.9
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/branch-0.9 by this push:
     new 868958d  [ZEPPELIN-5022]. InterpreterSetting's status is not saved after downloading dependencies
868958d is described below

commit 868958d5851a67881ea4fef925ac890f54a1cd0d
Author: Jeff Zhang <zj...@apache.org>
AuthorDate: Fri Aug 28 15:39:51 2020 +0800

    [ZEPPELIN-5022]. InterpreterSetting's status is not saved after downloading dependencies
    
    ### What is this PR for?
    
    Straightforward PR which just save interpreter setting file when dependencies downloading are completed.
    
    ### What type of PR is it?
    [Bug Fix ]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-5022
    
    ### How should this be tested?
    * Manually tested
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Jeff Zhang <zj...@apache.org>
    
    Closes #3893 from zjffdu/ZEPPELIN-5022 and squashes the following commits:
    
    cb4761d5c [Jeff Zhang] [ZEPPELIN-5022]. InterpreterSetting's status is not saved after downloading dependencies
    
    (cherry picked from commit e308c58d72a8c1a784f01a165c53d3fb16d6fcde)
    Signed-off-by: Jeff Zhang <zj...@apache.org>
---
 .../apache/zeppelin/interpreter/InterpreterSetting.java    | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
index c4a507a..6ef5e28 100644
--- a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
+++ b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterSetting.java
@@ -690,7 +690,9 @@ public class InterpreterSetting {
 
   public void setDependencies(List<Dependency> dependencies) {
     this.dependencies = dependencies;
-    loadInterpreterDependencies();
+    if (!this.dependencies.isEmpty()) {
+      loadInterpreterDependencies();
+    }
   }
 
   public InterpreterOption getOption() {
@@ -719,7 +721,9 @@ public class InterpreterSetting {
         this.dependencies.add(dependency);
       }
     }
-    loadInterpreterDependencies();
+    if (!dependencies.isEmpty()) {
+      loadInterpreterDependencies();
+    }
   }
 
   void setInterpreterOption(InterpreterOption interpreterOption) {
@@ -1007,6 +1011,12 @@ public class InterpreterSetting {
           setErrorReason(e.getLocalizedMessage());
           setStatus(Status.ERROR);
         }
+
+        try {
+          interpreterSettingManager.saveToFile();
+        } catch (IOException e) {
+          LOGGER.error("Fail to save interpreter.json", e);
+        }
       }
     };