-
Notifications
You must be signed in to change notification settings - Fork 177
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
bug: robot-server errors during shutdown if there's an active RPC connection #8155
Comments
I believe this is moot with the merge of #8913, which removed this RPC endpoint entirely. I don't know about the "Cannot call 'send' once a close message has been sent" error, but the "Connection cannot be closed in state ConnectionState.LOCAL_CLOSING" error looks to have been caused by this: opentrons/robot-server/robot_server/service/legacy/rpc/rpc.py Lines 67 to 76 in 92f7962
Closing each open WebSocket on shutdown like this was apparently correct when robot-server was on aiohttp, but incorrect after we ported it to FastAPI. This is because FastAPI shutdown handlers run after all connections are already closed (I think), so closing them again here was redundant and an error. |
Overview
The
opentrons-robot-server
service shows errors if it's shut down under certain circumstances, even though the shutdown is supposed to be graceful. This maybe suggests buggy handling of some resource lifetimes?Steps to reproduce
journalctl -f -u opentrons-robot-server
.systemctl stop opentrons-robot-server
over SSH.Current behavior
These errors are printed:
And this one, which is more concerning because it happens during the ASGI shutdown handler, which may prevent subsequent shutdown handlers from running and hide further errors.
Expected behavior
opentrons-robot-server
should shut down cleanly.The text was updated successfully, but these errors were encountered: