-
Notifications
You must be signed in to change notification settings - Fork 272
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
Only set disconnected time when it is not already set. #237
Conversation
So looking at this change in isolation, I'm curious what effect it would have - did you write it anticipating solving a race condition, or something else? I'd like to see a comment with it because otherwise it looks like you're avoiding replacing a number with another similar-size number which would not really affect memory. |
Nov 27 13:20:47 python3[28665]: File "/var/lib/wwwrun/.virtualenvs//lib/python3.6/site-packages/channels/consumer.py", line 81, in send Nov 27 13:20:47 python3[28665]: await self.base_send(message) Nov 27 13:20:47 python3[28665]: File "/var/lib/wwwrun/.virtualenvs//lib/python3.6/site-packages/channels/sessions.py", line 232, in send Nov 27 13:20:47 python3[28665]: return await self.real_send(message) Nov 27 13:20:47 python3[28665]: File "/var/lib/wwwrun/.virtualenvs//lib/python3.6/site-packages/daphne/server.py", line 213, in handle_reply Nov 27 13:20:47 python3[28665]: if self.connections[protocol].get("disconnected", None): Nov 27 13:20:47 python3[28665]: KeyError: <WebSocketProtocol client=None path=b'/vnc/devices/'>
This reverts commit f0c9878.
I wrote the details in the bug thread. Avoiding writing a bigger number is what we are doing because if it does the time difference will never be large enough to be cleaned up.
To experience this just make a view that has time.sleep(999999) with a low http_timeout. |
I added another fix that handles an exception where send is called on an application instance that has been cleaned up. I see that exception a few times a day. I added comments for both changes. |
Great, thanks for adding the comment! |
I'll try to get a release out this week - I forgot to roll one along with Channels last week. |
It's now out in |
Great thanks.
…On Sat, Dec 15, 2018, 4:36 PM Andrew Godwin ***@***.*** wrote:
It's now out in 2.2.4.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#237 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB8pv1pGPMawQQF3gM6o0cQMeLuPuiohks5u5WtFgaJpZM4Y1_JP>
.
|
This is fix 1 of 2 for django/channels#1181.