zjffdu commented on a change in pull request #4252:
URL: https://github.com/apache/zeppelin/pull/4252#discussion_r742585405



##########
File path: 
zeppelin-zengine/src/main/java/org/apache/zeppelin/notebook/NoteManager.java
##########
@@ -651,5 +667,63 @@ public void updateNotePath() {
     }
   }
 
+  /**
+   * Unloads notes when reasonable amount of notes are in loaded state.
+   * Leverage a simple LRU cache for determing evictable notes. Ensure to
+   * not evict notes during save operation (dirty).

Review comment:
       @Reamer I still think there are still potential issue here. Let's say 
the number of notes in LRUCache is equal to 50, and now there's one call of 
handleEviction which will evict one note (Note#unload is called). At the same 
time, there're 50 threads (each thread read one note) which all call 
NotebookServer#broadcastNote to deserialize note to frontend. So at least one 
of them will be affected (one note will be unload). I have to admin it is very 
unlikely unless very high concurrency. But in theory, this kind of case exists. 




-- 
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-unsubscr...@zeppelin.apache.org

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


Reply via email to