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

Django 3.2.2 & "Application instance <Task pending [...] took too long to shut down and was killed." issue #298

Open
Sajam opened this issue May 7, 2021 · 1 comment
Labels

Comments

@Sajam
Copy link

Sajam commented May 7, 2021

Hi guys!

First - thanks for your hard work - we're heavily using your package for our health check and it works great!

To the point: we recently upgraded Django to version 3.2.2 and we started to receive the following errors (example one, there are different variations of it depending on a check):

Application instance <Task pending name='Task-387' coro=<StaticFilesWrapper.__call__() running at /usr/local/lib/python3.9/site-packages/channels/staticfiles.py:44> wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel() at /usr/local/lib/python3.9/asyncio/futures.py:384, <TaskWakeupMethWrapper object at 0x7f78e86dafd0>()]>> for connection <WebSocketProtocol client=['172.18.0.11', 52972] path=b'/ws/user/'> took too long to shut down and was killed.

When we tried to open the health check page it just hung and never loaded.

After hours of debugging, we discovered (thanks to Maciek!) that it was enough to re-register default plugins in our AppConfig:

Selection_999(922)

... and it started to work again!

I'm wondering if it has something to do with minor changes to AppConfig in Django 3.2 described here: https://docs.djangoproject.com/en/3.2/releases/3.2/#automatic-appconfig-discovery but I wasn't able to verify/tell what is the root cause.

Posting it for future reference and maybe someone will be able to find and fix the root issue.

Thanks,
Daniel

@Sajam Sajam changed the title Django 3.2 & "Application instance <Task pending [...] took too long to shut down and was killed." issue Django 3.2.2 & "Application instance <Task pending [...] took too long to shut down and was killed." issue May 7, 2021
@codingjoe
Copy link
Collaborator

Hi @Sajam,

I honestly don't know. I am not so involved with this part of the Django development. Besides, I currently don't use this package myself, so it's a bit harder to reproduce your scenario.

Therefore, if anyone has more details on this, help would be more than welcome.

Best,
Joe

@codingjoe codingjoe added the bug label May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants