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

Suggestion: auto-retry? #151

Closed
omgitsraven opened this issue Aug 10, 2019 · 10 comments
Closed

Suggestion: auto-retry? #151

omgitsraven opened this issue Aug 10, 2019 · 10 comments

Comments

@omgitsraven
Copy link

omgitsraven commented Aug 10, 2019

I'm trying to send a large file to a friend who has a flaky connection, and while the resume function is working, we always have to manually re-connect on both ends every time something goes wrong, which means that the transfer can't continue until we're both back at our keyboards.

Specifically, on the sending end I'm seeing:

file.7z  28% |█████               | (3.8 MB/s) [5m8s:3h18m53s]panic: wanted to write 32814 but wrote 0: write tcp 192.168.0.187:61046->142.---.---.---:9010: wsasend: An existing connection was forcibly closed by the remote host.

goroutine 15 [running]:
github.com/schollz/croc/v6/src/croc.(*Client).sendData(0xc00003d200, 0x0)
        /home/zns/go/src/github.com/schollz/croc/src/croc/croc.go:988 +0x7cf
created by github.com/schollz/croc/v6/src/croc.(*Client).updateState
        /home/zns/go/src/github.com/schollz/croc/src/croc/croc.go:842 +0x222

Does that seem like the type of error that, rather than crashing, both ends could safely recognize and auto-reattempt (like once a minute or so) until the connection is re-established? Or does the NAT traversal situation mean that we'd have to go through the relay again? (Even then, while I understand that you wouldn't want TOO much traffic to the relay coming from auto-reattempts running all day, maybe trying three times before giving up or something wouldn't be too much of an extra load?)

@schollz
Copy link
Owner

schollz commented Aug 12, 2019

@omgitsraven I like this idea.

Maybe it could be a flag? Like --reconnect, where if its enabled it will keep reconnecting on broken connections.

@omgitsraven
Copy link
Author

That could work, although it'd either mean suffering one failed attempt in order to find out you need it, or else including the flag all the time just in case you do... Like, what would be someone's motivation not to use the flag just in case?

@golubaca
Copy link

golubaca commented Sep 4, 2020

Enabled by default seems like an good option for me. I throws a panic, so recover will be enough to try again. You can maybe set a default flag to retry attempts (like 3 or so).

@nikoksr
Copy link
Contributor

nikoksr commented Sep 28, 2020

Mixing all answers together would mean that it is enabled by default and a flag like --no-reconnect is added to prevent croc from automatically reconnecting, which is a behavior I would definitely agree with.

@hsm2k3
Copy link

hsm2k3 commented Jul 29, 2022

@schollz I agree with @nikoksr. I would like this feature as well. Let me know what you want for this. Should the default be to auto reconnect if the transfer fails and a flag to disable? I'm still figuring out the code base, thank you.

@schollz
Copy link
Owner

schollz commented Jul 31, 2022

@schollz I agree with @nikoksr. I would like this feature as well. Let me know what you want for this. Should the default be to auto reconnect if the transfer fails and a flag to disable? I'm still figuring out the code base, thank you.

I'm not sure about the default. For now, just make a flag for it and I can think about it for a default. Let me know if you have any questions about the codebase as you dig in for the PR

hsm2k3 added a commit to hsm2k3/croc that referenced this issue Nov 15, 2022
…o-retry for issue schollz#151. Looking for some constructive criticism, thank you.
@formtapez
Copy link

Please dont forget this feature

@RLB2310
Copy link

RLB2310 commented May 19, 2024

Please add. large files don't reach EOF

@schollz
Copy link
Owner

schollz commented May 20, 2024

@RLB2310 @formtapez I will accept PR

@schollz schollz closed this as completed May 20, 2024
@hsm2k3
Copy link

hsm2k3 commented May 20, 2024

@schollz Would you mind keeping this open? I would like to come back to this.

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

7 participants