-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
JakartaWebSocketSession.close()
blocks long time when called from SendHandlerCallback
#8151
Labels
Bug
For general bugs on Jetty side
Comments
Interesting use case. |
lachlan-roberts
added a commit
that referenced
this issue
Jun 14, 2022
Signed-off-by: Lachlan Roberts <[email protected]>
lachlan-roberts
added a commit
that referenced
this issue
Jun 17, 2022
Signed-off-by: Lachlan Roberts <[email protected]>
lachlan-roberts
added a commit
that referenced
this issue
Jun 29, 2022
Issue #8151 - make websocket close non-blocking
fixes merged with #8164 |
joakime
changed the title
Jetty 11: JakartaWebSocketSession.close() blocks long time when called from SendHandlerCallback
Sep 9, 2022
JakartaWebSocketSession.close()
blocks long time when called from SendHandlerCallback
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jetty version(s)
11.0.9
(worked with 9.4.44.v20210927)
Java version/vendor
(use: java -version)
temurin-17.0.2
OS type/version
Ubuntu Linux
Description
JakartaWebSocketSession.close() blocks when it is invoked from a SendHandlerCallback. In fact, it only unblocks after the idle timeout. Example (see also attached project):
Result:
This seems to be due to the fact that the previous (outer) callback is not yet terminated when
close()
is called.Note that the same code worked without blocking in Jetty 9.4.44.v20210927. The attached project also contains an example for it.
This is a common use case I guess, since many protocolls will send a last message to the client before closing the connection.
How to reproduce?
See attachment, which is a maven project.
Start TestServerJetty11 and connect using test.html.
embedded-jetty-websocket-examples.zip
The text was updated successfully, but these errors were encountered: