-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Implement a timeout #177
Comments
🤔 a timeout on what? can you be more specific? |
For handling the requests timeouts, I have something like echo "# Django Workers" > $FILE
sudo fuser -k $PORT/tcp
gunicorn mysite.asgi --timeout $TIMEOUT --workers $THREADS --worker-class uvicorn.workers.UvicornWorker & echo "starting server..."
sleep $SLEEP_TIME
echo "## ASGI Gunicorn Uvicorn" >> $FILE
bench
sudo fuser -k $PORT/tcp
granian --interface asgi mysite.asgi:application --port $PORT --workers $THREADS --loop asyncio & echo "starting server..."
sleep $SLEEP_TIME
echo "## Granian Asyncio" >> $FILE
bench
sudo fuser -k $PORT/tcp
granian --interface asgi mysite.asgi:application --port $PORT --workers $THREADS --loop uvloop & echo "starting server..."
sleep $SLEEP_TIME
echo "## Granian uvloop" >> $FILE
bench
sudo fuser -k $PORT/tcp And I thought if each server would have different timeout it should affect the results, and I'm working over Heroku, it has a request timeout of 30 seconds My benchmark is not so realistic, I think but cover a lot of common tasks
I got good results, but I could not get any good results for AIOHTTP or HTTPX test, so I think maybe the default request timeout should affect to Granian result |
And it appears even with [WARNING] Application callable raised an exception
Task exception was never retrieved
future: <Task finished name='Task-55077' coro=<future_watcher_wrapper.<locals>.future_watcher() done, defined at /home/jefer/dev/work/apiv2/benchmarks/django-workers/.venv/lib/python3.11/site-packages/granian/_futures.py:2> exception=TypeError('PyFutureAwaitable.cancel() takes no arguments (1 given)')>
Traceback (most recent call last):
File "/home/jefer/dev/work/apiv2/benchmarks/django-workers/.venv/lib/python3.11/site-packages/granian/_futures.py", line 4, in future_watcher
await inner(watcher.scope, watcher.proto)
File "/home/jefer/dev/work/apiv2/benchmarks/django-workers/.venv/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 170, in __call__
await self.handle(scope, receive, send)
File "/home/jefer/dev/work/apiv2/benchmarks/django-workers/.venv/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 218, in handle
task.cancel()
TypeError: PyFutureAwaitable.cancel() takes no arguments (1 given)
Task exception was never retrieved
future: <Task finished name='Task-55434' coro=<ASGIHandler.listen_for_disconnect() done, defined at /home/jefer/dev/work/apiv2/benchmarks/django-workers/.venv/lib/python3.11/site-packages/django/core/handlers/asgi.py:226> exception=RequestAborted()>
Traceback (most recent call last):
File "/home/jefer/dev/work/apiv2/benchmarks/django-workers/.venv/lib/python3.11/site-packages/django/core/handlers/asgi.py", line 230, in listen_for_disconnect
raise RequestAborted()
django.core.exceptions.RequestAborted |
@jefer94 1.0 added the proper code to handle As for the timeout thing, I'm still not convinced Granian should implement this and leave it to the application/framework. |
I will make an endpoint in Heroku with an |
A timeout would be nice, timeout with the proxy, nging or whatever, just like unicorn and gunicorn |
Something like
--timeout 30
, I'm writing a benchmark and I need to set this valueThe text was updated successfully, but these errors were encountered: