Skip to content
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

Merged
merged 6 commits into from
Sep 17, 2024

Conversation

johannesschillinger-dm
Copy link
Contributor

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:

  • Does the license files need to update? No
  • Is there breaking changes for older versions? No
  • Does this needs documentation? No

also add debug logging to the class
@johannesschillinger-dm johannesschillinger-dm changed the title [ZEPPELIN-1480] synchronize websocket sync to prevent issues with blocked websockets due to multithreading [ZEPPELIN-1480] rework websocket sending to prevent partial server hangup Sep 9, 2024
@johannesschillinger-dm johannesschillinger-dm changed the title [ZEPPELIN-1480] rework websocket sending to prevent partial server hangup [ZEPPELIN-1480] rework websocket sending to prevent partial frontend hangup Sep 9, 2024
@johannesschillinger-dm
Copy link
Contributor Author

@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.

Copy link
Contributor

@Reamer Reamer left a 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?

}

public void send(String serializeMessage) throws IOException {
session.getBasicRemote().sendText(serializeMessage);
session.getAsyncRemote().sendText(serializeMessage, result -> {
Copy link
Contributor

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

Copy link
Contributor

@Reamer Reamer left a 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.

Copy link
Contributor

@Reamer Reamer left a 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?

@jongyoul
Copy link
Member

Nope. LGTM

@Reamer Reamer merged commit a985c56 into apache:master Sep 17, 2024
28 checks passed
@Reamer
Copy link
Contributor

Reamer commented Sep 17, 2024

Thank you very much for your contribution. Hoping for more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants