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

websocket container stop ordering #4919

Open
lachlan-roberts opened this issue May 28, 2020 · 5 comments · Fixed by #4931
Open

websocket container stop ordering #4919

lachlan-roberts opened this issue May 28, 2020 · 5 comments · Fixed by #4931
Assignees

Comments

@lachlan-roberts
Copy link
Contributor

Jetty version
10.0.x

Description
In tests which do not explicitly close the all open WebSocket sessions, we frequently get the stack trace error message from onError.

2020-05-28 16:44:19.365:WARN :oejwjtc.DecoderListTest$DecoderListEndpoint:qtp396883763-17: Unhandled Error: org.eclipse.jetty.websocket.javax.tests.coders.DecoderListTest$DecoderListEndpoint@4947d28
java.nio.channels.ClosedChannelException
	at org.eclipse.jetty.websocket.core.internal.WebSocketSessionState.onEof(WebSocketSessionState.java:172)
	at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.onEof(WebSocketCoreSession.java:323)
	at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.onClose(WebSocketConnection.java:169)
	at org.eclipse.jetty.io.SelectorManager.connectionClosed(SelectorManager.java:334)
	at org.eclipse.jetty.io.ManagedSelector$DestroyEndPoint.run(ManagedSelector.java:1060)
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:823)
	at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:945)
	at java.base/java.lang.Thread.run(Thread.java:834)

I think this is because the WebSocket containers are not shutting down in the correct order when doStop is called. The order we want is:

  1. Stop accepting new websocket connections.
  2. Stop the SessionTracker which will close any existing connections.
  3. Shut down everything else.

We should review the stop order for the client and server containers on both the Javax and Jetty API implementations. The server containers might need to implement the Graceful interface to do this properly.

@lachlan-roberts lachlan-roberts self-assigned this May 28, 2020
lachlan-roberts added a commit that referenced this issue Jun 2, 2020
lachlan-roberts added a commit that referenced this issue Jun 2, 2020
lachlan-roberts added a commit that referenced this issue Jul 22, 2020
lachlan-roberts added a commit that referenced this issue Jul 28, 2020
Signed-off-by: Lachlan Roberts <[email protected]>
lachlan-roberts added a commit that referenced this issue Jul 28, 2020
lachlan-roberts added a commit that referenced this issue Jul 29, 2020
…ainerStop

Issue #4919 - WebSocket container graceful stop
@lachlan-roberts
Copy link
Contributor Author

PR #4931 ensures that we try closing all open sessions before closing the Connectors.

We should also ensure we do not accept any new websocket connections once we start the Graceful shutdown.

@github-actions
Copy link

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Feb 25, 2022
@lachlan-roberts lachlan-roberts removed the Stale For auto-closed stale issues and pull requests label Feb 25, 2022
@github-actions
Copy link

github-actions bot commented Mar 1, 2023

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Mar 1, 2023
@github-actions
Copy link

github-actions bot commented Apr 2, 2023

This issue has been closed due to it having no activity.

@github-actions github-actions bot closed this as completed Apr 2, 2023
@joakime joakime removed the Stale For auto-closed stale issues and pull requests label Apr 2, 2023
@joakime joakime reopened this Apr 2, 2023
Copy link

github-actions bot commented Apr 2, 2024

This issue has been automatically marked as stale because it has been a
full year without activity. It will be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the Stale For auto-closed stale issues and pull requests label Apr 2, 2024
@sbordet sbordet removed the Stale For auto-closed stale issues and pull requests label Apr 2, 2024
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 a pull request may close this issue.

3 participants