-
Notifications
You must be signed in to change notification settings - Fork 204
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 IO::Error #1184
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
An Unhandled exception in spawn: Closed stream (IO::Error) can be raised if the socket connection is closed and data is then written.
Steps to Reproduce
I don't have exact steps for timing out the connection, but it looks like an IO::Error can be raised in the while block, I'm not sure if it's because the error trace doesn't specify the location within the while block or if it's really the first line. It looks odd to me that the connection is checked for a close then there's a sleep, then the .beat (write). That would give the connection a chance to close and still have a write.
edit: It looks like beat() has a rescue IO::Error, so I assume it isn't coming from beat() unless disconnect! can cause a write.
https://github.com/amberframework/amber/blob/master/src/amber/websockets/client_sockets.cr#L14
Here's the code, lines 14-18.
Expected behavior:
IO::Error will not be raised.
Actual behavior:
IO::Error is raised
Reproduces how often:
It's a timing issue, but not too often. Maybe once per day per user?
Versions
0.33.0
Additional Information
I'm using Redis with the websocket.
The text was updated successfully, but these errors were encountered: