Skip to content

Commit 6a90cac

Browse files
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 <[email protected]> Closes #1437 from prabhjyotsingh/ZEPPELIN-1454 and squashes the following commits: f94125c [Prabhjyot Singh] ZEPPELIN-1454: read from file-system after saving
1 parent f2a5c59 commit 6a90cac

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

zeppelin-zengine/src/main/java/org/apache/zeppelin/interpreter/InterpreterFactory.java

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -853,17 +853,21 @@ public void setPropertyAndRestart(String id, InterpreterOption option, Propertie
853853
synchronized (interpreterSettings) {
854854
InterpreterSetting intpsetting = interpreterSettings.get(id);
855855
if (intpsetting != null) {
856-
857-
stopJobAllInterpreter(intpsetting);
858-
859-
intpsetting.closeAndRmoveAllInterpreterGroups();
860-
861-
intpsetting.setOption(option);
862-
intpsetting.setProperties(properties);
863-
intpsetting.setDependencies(dependencies);
864-
865-
loadInterpreterDependencies(intpsetting);
866-
saveToFile();
856+
try {
857+
stopJobAllInterpreter(intpsetting);
858+
859+
intpsetting.closeAndRmoveAllInterpreterGroups();
860+
intpsetting.setOption(option);
861+
intpsetting.setProperties(properties);
862+
intpsetting.setDependencies(dependencies);
863+
loadInterpreterDependencies(intpsetting);
864+
865+
saveToFile();
866+
} catch (Exception e) {
867+
throw e;
868+
} finally {
869+
loadFromFile();
870+
}
867871
} else {
868872
throw new InterpreterException("Interpreter setting id " + id + " not found");
869873
}

0 commit comments

Comments
 (0)