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

Issue #4907 - close websocket suspendState if close frame is received #4912

Merged

Conversation

lachlan-roberts
Copy link
Contributor

Closes #4907

Fixes flaky test SuspendResumeTest.testSuspendAfterClose().

If a close frame is received we must close the suspend state so any subsequent calls to suspend() and resume() will throw IllegalStateException.

The transition to the close state must be done both when receiving a close frame before the WebSocketFrameListener is called, and in the case when we never received a close frame but the connection has been closed.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts lachlan-roberts requested a review from gregw May 27, 2020 00:19
@lachlan-roberts
Copy link
Contributor Author

@gregw nudge

Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid double lock

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts lachlan-roberts requested a review from gregw June 22, 2020 03:48
@lachlan-roberts
Copy link
Contributor Author

@gregw nudge

@lachlan-roberts lachlan-roberts merged commit 33852f5 into jetty-10.0.x Jul 6, 2020
@lachlan-roberts lachlan-roberts deleted the jetty-10.0.x-4907-suspendAfterCloseRace branch July 6, 2020 02:54
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.

org.eclipse.jetty.websocket.tests.SuspendResumeTest#testSuspendAfterClose
2 participants