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

pdallig pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zeppelin.git


The following commit(s) were added to refs/heads/master by this push:
     new 987c0b7  [ZEPPELIN-5572] resolve the websocket deadlock problem
987c0b7 is described below

commit 987c0b70325ffbcd061be7784f84eb32a1b6cb72
Author: xiejiajun <xiejiaju...@163.com>
AuthorDate: Fri Nov 12 11:08:19 2021 +0800

    [ZEPPELIN-5572] resolve the websocket deadlock problem
    
    ### What is this PR for?
    - The 
org.eclipse.jetty.websocket.common.WebSocketRemoteEndpoint#blockingWrite method 
has been to ensure that the websocket sends messages serially by 
`ReentrantLock` and `WriteBlocket`, so the NotebookSocket.send method does not 
need to be locked.
    - If we lock the NotebookSocket.send method, the NotebookServer#onClose 
method will be triggered when the NotebookSocket.send method sends a message 
abnormally. At this time, if there are other threads that need to send messages 
through the current Websocket Session to preempt the noteSocketMap lock in the 
ConnectionManager,  It will trigger a deadlock.
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * [ZEPPELIN-5572](https://issues.apache.org/jira/browse/ZEPPELIN-5572)
    
    ### How should this be tested?
    * CI
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: xiejiajun <xiejiaju...@163.com>
    
    Closes #4264 from xiejiajun/ZEPPELIN-5572 and squashes the following 
commits:
    
    015901df0 [xiejiajun] Merge branch 'local/dev-base' into ZEPPELIN-5572
    be8e4ce90 [xiejiajun] Remove unnecessary locks to resolve the deadlock 
problem
---
 .../src/main/java/org/apache/zeppelin/socket/NotebookSocket.java        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java 
b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
index c9f0a64..609b4bb 100644
--- 
a/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
+++ 
b/zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
@@ -40,7 +40,7 @@ public class NotebookSocket {
     return String.valueOf(headers.get(key));
   }
 
-  public synchronized void send(String serializeMessage) throws IOException {
+  public void send(String serializeMessage) throws IOException {
     session.getBasicRemote().sendText(serializeMessage);
   }
 

Reply via email to