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

took too long to shut down and was killed error #1685

Closed
belongwqz opened this issue Apr 22, 2021 · 5 comments
Closed

took too long to shut down and was killed error #1685

belongwqz opened this issue Apr 22, 2021 · 5 comments

Comments

@belongwqz
Copy link

OS: windowns7
django:3.1.8
channels:2.4.0
daphne:2.5.0
asgiref:3.2.10
channels_redis:3.1.0

I flow the channels doc from https://channels.readthedocs.io/ to create a django project with channels.
The I run python manage.py runserver, and I visit http://localhost:8000 use chrome 90.
The console print some error like:
Application instance <Task pending name='Task-8' coro=<AsgiHandler.__call__() running at D:\Python38\lib\site-packages\channels\http.py:192> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at D:\Python38\lib\asyncio\futures.py:360, <TaskWakeupMethWrapper object at 0x000000002B20F100>()]>> for connection <WebRequest at 0x2b4b2700 method=GET uri=/ clientproto=HTTP/1.1> took too long to shut down and was killed.

And the chrome can not open the address http://localhost:8000, what I should do to find the hang reason?

@youssef-elmasry-lenme
Copy link

I've similar issue, did you get a solution for this ? @belongwqz

@belongwqz
Copy link
Author

I've similar issue, did you get a solution for this ? @belongwqz

Not yet, I just rollback to the old version.

@carltongibson
Copy link
Member

Duplicate of #1119

@carltongibson carltongibson marked this as a duplicate of #1119 Jul 1, 2021
@destelio
Copy link

destelio commented Feb 22, 2022

have you tried used the WebSocket reconnect library?

sources:
https://github.com/joewalnes/reconnecting-websocket
https://www.npmjs.com/package/reconnecting-websocket

you need to add this to your html:

<script src='https://cdnjs.cloudflare.com/ajax/libs/reconnecting-websocket/1.0.0/reconnecting-websocket.js'
></script>

and where you call WebSocket in JavaScript switch from WebSocket to ReconnectingWebSocket
var socket = new ReconnectingWebSocket(endpoint)

refresh your browsers where you monitor messages (and incognito)

and it should work, i faced a similar issue... and this solution works for me.

kudos to justin mitchel, @https://github.com/codingforentrepreneurs for figuring this solution out.

@carltongibson
Copy link
Member

Hey @destelio — thanks for mentioning that library. It may well be a handy resource to point to...

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

No branches or pull requests

4 participants