-
Notifications
You must be signed in to change notification settings - Fork 379
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
Socket leak #615
Comments
I’m going to need more details. Like, the function where the You see, there’s no reconnection logic in our library. We only generate a new socket in Perhaps, also you might be falling into a known gotcha where there is some code like:
In the above code, the defer is scheduled for the end of the whole function containing the |
Hello, I will review my code and the loop more deeply with your advices, and come back to you if I can give more details. |
If you are indeed performing:
Per upload, then you are indeed not reusing connections, and the issue would also indeed be too many sockets open. (More precisely, the You should not need to be doing a new |
Hello,
I have an application that upload files to a remote server using sftp. I upload files with io.Copy().
Last night the remote server had his file system full, causing io.Copy return SSH_FX_FAILURE error.
At each error we retry the upload with the same connection considering the connection is ok. But at the end, after a while, the process fall with "too many open files". Using lsof on the process I found thousands of opened socket on the remote server. (reproducible)
It seems that when there is an error on a connection, the socket remains opened and the library open a new socket, causing leaking.
Can you confirm that ? is it "normal" behavior ?
thanks for you answer.
jf
The text was updated successfully, but these errors were encountered: