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
Sanic hangs for around 20 seconds after every 3 minutes #2883
Comments
Please provide a link to your code so that we can review. |
The code is in private repository, sorry can't share the link of the same. Or if you can share what specific part of code/configuration you want to see, will try to share that separately. |
Since we don't know your code, we can't really tell you what we'd want to see. What I can tell you is that whatever that code is likely has some blocking calls in it due to the fact that it's taking so long (~ 20 seconds) but as a background task, it should not be impacting the rest of your application. I am guessing this is something you took over, not wrote yourself? |
@sham-hq Would be happy to help you, though if I've got it right you cannot share code "as is". I am seconding @sjsadowski comment on the blocking call which takes too long. Have you tried to play with number of workers ? |
Link to code
No response
Proposal
I am using Sanic version 21.12.1 on Ubuntu 20.04.5 and below is my code to start the sanic server:
The issue I am facing is, after every 3 minutes, server hangs for 20 seconds and then after 20 seconds starts responding. So I started sanic with Debug True, and what I found is, before printing below line, server hangs for 20 secs, and after below line appears in log, sanic resumes responding:
Executing <Task pending name='Task-36' coro=<SignalRouter._dispatch() running at /home/ubuntu/.local/lib/python3.8/site-packages/sanic/signals.py:161> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f5d2c2e0d60>()] created at /usr/lib/python3.8/asyncio/tasks.py:654> created at /home/ubuntu/.local/lib/python3.8/site-packages/sanic/signals.py:193> took 20.112 seconds
This is happening after every around 3 mins.
Can anybody please guide me what is this and how to solve/handle it?
Thanks
Additional context
No response
Is this a breaking change?
The text was updated successfully, but these errors were encountered: