Repository: zeppelin
Updated Branches:
  refs/heads/master f2a5c594d -> 6a90cacc1


ZEPPELIN-1454: Wrong property value on interpreter page

### What is this PR for?
If for some reason (for example permission issue in file system) while saving 
interpreter setting, UI shows wrong value till the next restart.
IMO interpreter.json should be the source of truth, that should always be 
reflected on UI

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

### Todos
* [x] - read from file-system after saving

### What is the Jira issue?
* [ZEPPELIN-1454](https://issues.apache.org/jira/browse/ZEPPELIN-1454)

### How should this be tested?
Change file system permission of "interpreter.json", and make it readonly, then 
on interpreter setting page try and change any property and refresh the page, 
refer screenshot

### Screenshots (if appropriate)
Before
![fix-permission-before](https://cloud.githubusercontent.com/assets/674497/18627830/ced6673a-7e7a-11e6-88a6-426e1d2d2582.gif)

After
![fix-permission-after](https://cloud.githubusercontent.com/assets/674497/18627831/ceda24f6-7e7a-11e6-880b-4a7d1f9be3d8.gif)

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

Author: Prabhjyot Singh <prabhjyotsi...@gmail.com>

Closes #1437 from prabhjyotsingh/ZEPPELIN-1454 and squashes the following 
commits:

f94125c [Prabhjyot Singh] ZEPPELIN-1454: read from file-system after saving


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

Branch: refs/heads/master
Commit: 6a90cacc150fba36803f7cb802d7c4e9355f77e3
Parents: f2a5c59
Author: Prabhjyot Singh <prabhjyotsi...@gmail.com>
Authored: Mon Sep 19 15:05:11 2016 +0530
Committer: Prabhjyot Singh <prabhjyotsi...@gmail.com>
Committed: Thu Sep 22 15:22:33 2016 +0530

----------------------------------------------------------------------
 .../interpreter/InterpreterFactory.java         | 26 +++++++++++---------
 1 file changed, 15 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/6a90cacc/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
----------------------------------------------------------------------
diff --git 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
index 5545e9b..47ff946 100644
--- 
a/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
+++ 
b/zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java
@@ -853,17 +853,21 @@ public class InterpreterFactory implements 
InterpreterGroupFactory {
     synchronized (interpreterSettings) {
       InterpreterSetting intpsetting = interpreterSettings.get(id);
       if (intpsetting != null) {
-
-        stopJobAllInterpreter(intpsetting);
-
-        intpsetting.closeAndRmoveAllInterpreterGroups();
-
-        intpsetting.setOption(option);
-        intpsetting.setProperties(properties);
-        intpsetting.setDependencies(dependencies);
-
-        loadInterpreterDependencies(intpsetting);
-        saveToFile();
+        try {
+          stopJobAllInterpreter(intpsetting);
+
+          intpsetting.closeAndRmoveAllInterpreterGroups();
+          intpsetting.setOption(option);
+          intpsetting.setProperties(properties);
+          intpsetting.setDependencies(dependencies);
+          loadInterpreterDependencies(intpsetting);
+
+          saveToFile();
+        } catch (Exception e) {
+          throw e;
+        } finally {
+          loadFromFile();
+        }
       } else {
         throw new InterpreterException("Interpreter setting id " + id + " not 
found");
       }

Reply via email to