-
-
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
Connections hang in CLOSE-WAIT state #3182
Comments
This appears to be specifically related to The following doesn't cause this issue:
|
I can confirm this behavior. The number of connections that hang in the CLOSE-WAIT state increases every time a too-large payload has been sent. I'd very much appreciate a fix, as we are having huge issues in production right now. I'd also be willing to contribute, but I'm currently having difficulties finding my way around the codebase. My guess is something has to change in |
I am experiencing a similar issue. After deploying my website, it becomes inaccessible after running for some time. Upon investigation, I discovered a large number of connections stuck in the CLOSE-WAIT state. Could you please advise on how to resolve this problem? Thank you for your assistance. |
I did some systematic testing to narrow down the problem, by modifying the following parameters:
On the client-side, I used the Python session = requests.Session()
session.headers["Connection"] = "close" | "keep-alive"
session.post(...)
|
Hey everyone, Is this problem resolved? When I use async http libs on Python, I'm getting this issue |
If a post request with a large body gets error (413 or 404 or any other) as a response, the connection doesn't close, but hangs in
CLOSE-WAIT
stateExpected Behavior
After getting error connection is closed successfully
Current Behavior
Connection hangs in
CLOSE-WAIT
state with some bytes inRecv-Q
Possible Solution
As it only happens to requests with a large body, I guess there is something to do with the bytes that weren't read from a socket at the time the error happens. So we need to make sure these bytes are being read before closing the socket.
Steps to Reproduce (for bugs)
CLOSE-WAIT
state with a lot of bytes inRecv-Q
$ ss -n4t | grep 5556 FIN-WAIT-2 0 0 127.0.0.1:59240 127.0.0.1:5556 CLOSE-WAIT 787381 0 127.0.0.1:5556 127.0.0.1:59240
Context
We have an application that uses actix-web as http-api server. We've discovered that at some point it starts leaking the memory and connections. We've also found that another application is sending huge files to our app and keeps retrying as it gets 413 error. Future investigation showed that these things are connected and every 413 error leaves a connection in
CLOSE-WAIT
state. Later we managed to reproduce this problem with other errors (like 404 in the minimal example)Your Environment
The text was updated successfully, but these errors were encountered: