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
ConnectionClosedError raised from websockets library #757
Comments
Thanks for the detailed report @stefanw . What would help would be to know if this happens without gunicorn, just to make sure we throw that out of the equation. Then if you had a minimal example that would be amazing : I'm not that familiar with channels and I'm like missing ideas on how to "mimic" what you describe as a client disconnecting improperly, |
Hey @euri10, I added a passing test in PR #758 that asserts a raised exception under the described condition. The error only appears with the In the test I'm calling |
This issue is occurring for me without gunicorn (I am using Django channels also). |
FYI If I catch & ignore this exception in the |
Closing this as stale. Please feel free to reopen with an MRE if this still happens. |
Checklist
master
.Describe the bug
I'm running a Django project with channels and uvicorn (as a gunicorn worker).
Occasionally, when the server tries to send a message and the client has disconnected improperly, the following exception is raised from the
websockets
library:(full traceback under debugging below)
Expected behavior
As a user of channels, I expect not to be required to catch these lower-level exceptions in my message sending code (right? I'm a bit unsure about this). I would expect uvicorn to handle this exception from
websockets
.Actual behavior
I have to guard my websocket sending code against exceptions thrown by an implementation detail of the underlying ASGI server. I'm running the daphne ASGI server in development, so this exception handling is unexpected.
Debugging material
Full traceback
Environment
uvicorn.workers.UvicornWorker
The text was updated successfully, but these errors were encountered: