You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2022/05/30 11:05:41 UTC

[GitHub] [zeppelin] saLeox commented on a diff in pull request #4374: [ZEPPELIN-5744] Allow NoteManager for concurrent operation

saLeox commented on code in PR #4374:
URL: https://github.com/apache/zeppelin/pull/4374#discussion_r884708245


##########
zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NoteManager.java:
##########
@@ -181,7 +182,9 @@ public void saveNote(Note note, AuthenticationInfo subject) throws IOException {
     } else {
       addOrUpdateNoteNode(new NoteInfo(note));
       noteCache.putNote(note);
-      this.notebookRepo.save(note, subject);
+      synchronized (this) {

Review Comment:
   The reason makes it `synchronized` is that the `note` object will be empty in the case of concurrent saveNote, which comes from following code:
   ```note = notebookRepo.get(noteInfo.getId(), noteInfo.getPath(), AuthenticationInfo.ANONYMOUS);```
   And since it's just an abstract function, I just add `synchronized` to make it return non-empty object.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org