-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
last release (21.1.0) sends a lot of errors #3032
Comments
I was about to create a ticket regarding this update as well. I manage an API that processes around 2k-3K calls / second distribuite a couple of pods inside Kubernetes with an average of 150ms. Yesterday I had a hotfix regarding the API applied and I didn't notice I didn't have freeze the gunicorn in the requirements.txt file. As a result, Gunicorned instaled the latested version. I didn't notice at the time but, I notice after applying the patch my response times were averaging 600ms. It was a prod workload, so I undo de PR asap but couldn't get the response back to 150ms regardless what I did. Only today I decided to compare the packages and notice this in gunicorn. Put it back to 20.1.0 and now it looks beutiful again. Maybe that is related to the "send a lot of errors" above, that is taking too much CPU time away, idk, I know that performance to the 21.1.0 compared to the 20.1.0 went down by a LOT. |
@dkr-sahar 21.1.0 (out today) fix this error that was in 21.0.1. (out last night) Look at #3026. Are you sure about the version ? I don't reproduce it anymore after applying the fix. Please confirm. @rafaeljuzwiak same question :) |
Positive, I did restart my pods and built again (on version 21) this morning and I still had issues. I had to increase 4 pods in order to get production around the 250ms and still, with 4 less pods before I had around 150ms. I really don't want to test this on prod now as it already caused some fuzz, I can update sandbox latter today to give another try and get the feedback to you. |
Ps: Morning I mean around 8AM UTC, not sure what tz you are in and if I still got the previous unpatched version when I made the rebuild. |
i don't reproduce it. I don't see how it can be rzproduced in current version with the error catched. can you provide an example? Or more contewt ? What return the command line |
I had same problem with the latest gunicorn version. A rollback to
|
Please provide a way to reproduce it. I don't anymore since the patch :( |
I will try. Meanwhile, I am using the |
@benoitc I confirm that 21.1.0 fixed our issue (did not notice that it was 2hours ago) However we still have this problem that just appaeared. [2023-07-18 15:33:24 +0000] [17] [ERROR] Socket error processing request.
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/gunicorn/workers/gthread.py", line 280, in handle
req = next(conn.parser)
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/http/parser.py", line 42, in __next__
self.mesg = self.mesg_class(self.cfg, self.unreader, self.source_addr, self.req_count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/http/message.py", line 184, in __init__
super().__init__(cfg, unreader, peer_addr)
File "/usr/local/lib/python3.11/site-packages/gunicorn/http/message.py", line 55, in __init__
unused = self.parse(self.unreader)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/http/message.py", line 196, in parse
self.get_data(unreader, buf, stop=True)
File "/usr/local/lib/python3.11/site-packages/gunicorn/http/message.py", line 187, in get_data
data = unreader.read()
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/http/unreader.py", line 37, in read
d = self.chunk()
^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/gunicorn/http/unreader.py", line 64, in chunk
return self.sock.recv(self.mxchunk)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 9] Bad file descriptor It seems that it appears when a 500 error is raised (backend: django). |
I confirm that it seems to happen only when my backend (django too) is raising an exception. |
It could also arise in the following sequence:
Not totally sure of which way it works. |
Same as @dkr-sahar. All of this is happening in Docker in my case. |
Our CI (shame on us) installed [2023-07-18 17:33:38 +0000] [55] [ERROR] Socket error processing request. │
Traceback (most recent call last): │
File "/root/.pyenv/versions/3.8/lib/python3.8/site-packages/gunicorn/workers/gthread.py", line 285, in handle │
keepalive = self.handle_request(req, conn) │
File "/root/.pyenv/versions/3.8/lib/python3.8/site-packages/gunicorn/workers/gthread.py", line 357, in handle_request │
util.reraise(*sys.exc_info()) │
File "/root/.pyenv/versions/3.8/lib/python3.8/site-packages/gunicorn/util.py", line 641, in reraise │
raise value │
File "/root/.pyenv/versions/3.8/lib/python3.8/site-packages/gunicorn/workers/gthread.py", line 343, in handle_request │
resp.write(item) │
File "/root/.pyenv/versions/3.8/lib/python3.8/site-packages/gunicorn/http/wsgi.py", line 326, in write │
self.send_headers() │
File "/root/.pyenv/versions/3.8/lib/python3.8/site-packages/gunicorn/http/wsgi.py", line 322, in send_headers │
util.write(self.sock, util.to_bytestring(header_str, "latin-1")) │
File "/root/.pyenv/versions/3.8/lib/python3.8/site-packages/gunicorn/util.py", line 299, in write │
sock.sendall(data) │
OSError: [Errno 9] Bad file descriptor |
Same here, we have emissary in front of gunicorn. My logs shows around 10% of upstream connection closed with the following logs:
|
can someone test with the |
Python 3.10.12 and latest gunicorn stil nas this error:
|
@alpden550 you can use |
@revanthmahesh |
Python 3.6.7 OSError: [Errno 9] Bad file descriptor |
can someone test with the gh-thread branch ? #3033 Complaining that current release has an issue doesn't help that much. I don't reproduce the issue myself. thanks :) |
If it helps others down the road, we had a flask endpoint that would reliably fail / cause the bad file descriptor stack using 21.1.0. All it did was use requests to make an API call upstream and return the results. I can't easily test with the gthread branch @benoitc, but maybe this info is enough for you to update your test and check? |
gunicorn 21.2.0 has been released which is fixing this issue. |
Throwing random errors
The previous versions did not have this issue at all, was triggered in our latest build, so we’ll rollback version but still the problem remains in your latest release.
The text was updated successfully, but these errors were encountered: