-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ZEPPELIN-1480] rework websocket sending to prevent partial frontend hangup #4800
Conversation
…cked websockets due to multithreading
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
Outdated
Show resolved
Hide resolved
also add debug logging to the class
@jongyoul thank you for your feedback - I reworked the PR. Our production system suffered heavily from frontend lockups due to this issue. With the proposed patch applied, Zeppelin remains stable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all the debug outputs really necessary?
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
Outdated
Show resolved
Hide resolved
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
Outdated
Show resolved
Hide resolved
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
public void send(String serializeMessage) throws IOException { | ||
session.getBasicRemote().sendText(serializeMessage); | ||
session.getAsyncRemote().sendText(serializeMessage, result -> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This solution looks much better than the synchronize block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except two spaces.
zeppelin-server/src/main/java/org/apache/zeppelin/socket/NotebookSocket.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@jongyoul Any comments or can we merge this?
Nope. LGTM |
Thank you very much for your contribution. Hoping for more. |
What is this PR for?
Zeppelin Frontend sometimes stops working with following error in the log:
"Blocking message pending 10000 for BLOCKING"
According to Jetty documentation, Websocket writes need to be thread safe or the async functions need to be used.
This PR addresses the issue and makes the send requests thread safe
What type of PR is it?
Bug Fix
Todos
What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1480
How should this be tested?
This problem only occurs in production size deployments and is inherently a race condition
Questions: