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

Request hangs in unreader until timeout is reached #3061

Open
xcu opened this issue Sep 1, 2023 · 1 comment
Open

Request hangs in unreader until timeout is reached #3061

xcu opened this issue Sep 1, 2023 · 1 comment

Comments

@xcu
Copy link

xcu commented Sep 1, 2023

Hi all,

I'm having a strange issue where, a few times every day, a request hangs until the worker is restarted. According to the traceback it is hanging in the chunk function of unreader.py.

The request is a POST that contains an image, with content type header being something like
multipart/form-data; boundary=XXXXYYYYYYZZZZ

Gunicorn version 20.1.0, using only one worker in the pod.

File /home/cesar/.venv/lib/python3.9/site-packages/flask_restx/reqparse.py, line 216, in parse
File /home/cesar/.venv/lib/python3.9/site-packages/flask_restx/reqparse.py, line 141, in source
File /home/cesar/.venv/lib/python3.9/site-packages/werkzeug/utils.py, line 106, in __get__
File /home/cesar/.venv/lib/python3.9/site-packages/werkzeug/wrappers/request.py, line 498, in files
File /home/cesar/.venv/lib/python3.9/site-packages/flask/wrappers.py, line 114, in _load_form_data
File /home/cesar/.venv/lib/python3.9/site-packages/werkzeug/wrappers/request.py, line 270, in _load_form_data
File /home/cesar/.venv/lib/python3.9/site-packages/werkzeug/formparser.py, line 328, in parse
File /home/cesar/.venv/lib/python3.9/site-packages/werkzeug/formparser.py, line 357, in _parse_multipart
File /home/cesar/.venv/lib/python3.9/site-packages/werkzeug/formparser.py, line 495, in parse
File /home/cesar/.venv/lib/python3.9/site-packages/werkzeug/formparser.py, line 540, in _chunk_iter
File /home/cesar/.venv/lib/python3.9/site-packages/werkzeug/wsgi.py, line 804, in readinto
File /home/cesar/.venv/lib/python3.9/site-packages/newrelic/api/wsgi_application.py, line 119, in read
File /home/cesar/.venv/lib/python3.9/site-packages/gunicorn/http/body.py, line 215, in read
File /home/cesar/.venv/lib/python3.9/site-packages/gunicorn/http/body.py, line 130, in read
File /home/cesar/.venv/lib/python3.9/site-packages/gunicorn/http/unreader.py, line 37, in read
File /home/cesar/.venv/lib/python3.9/site-packages/gunicorn/http/unreader.py, line 64, in chunk
File /home/cesar/.venv/lib/python3.9/site-packages/gunicorn/workers/base.py, line 203, in handle_abort

Any ideas of what could be causing it? I can see that the line in question of unreader.py is doing
self.sock.recv(self.mxchunk)

So it seems like it hangs while waiting for the data?

@m-aamirmumtaz
Copy link

Can you please share how much data size in request body?

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

2 participants