-
Notifications
You must be signed in to change notification settings - Fork 381
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
Upload file hangs #502
Comments
Hi, I did a quick test, after a very long time the network disconnection is detected
about 17 minutes in my test. I think this error is detected in crypto/ssh, @puellanivis do you have any idea? |
🤔 I’m not sure how much we can really do here. Like you say, the network disconnect logic is not something we can control. Though, perhaps we could build a watchdog, but then the user could build a watchdog themselves, and then they could exert way better control on that. If this is going into some sort of service, or long-lived program, you’ll probably want some sort of disconnect/reconnect logic anyways? PS: If we do a v2 of the client API, then using contexts would make these timeout things much nicer. |
Hi, I did a quick test, after a very long time the network disconnection is detected
about 17 minutes. I think this error is detected in crypto/ssh, @puellanivis do you have any idea?
I don't think it will be that easy to interrupt an hanging read/write, but I could be wrong |
If I were running into this issue myself, I would probably implement a work-around piecemeal I’m not sure that we could fix anything on our end… if the |
I agree, this can be easily fixed on the application side. I periodically issue a Getwd command and if I get no response after 30 seconds I close the connection |
package version: github.com/pkg/sftp v1.13.4
Error: Manually cut off the network, the program hangs at the uploading file.
Expect: Detect network disconnection and return errors in a timely manner.
Code:
This feature is very important for automatically monitoring the directory and uploading files continuously, otherwise a network interruption may cause the program hangs forever.
The text was updated successfully, but these errors were encountered: