Closed SeppeSoete closed 3 years ago
Thank you for submitting this PR! A maintainer will be here shortly to review it. We are super grateful, but we are also overloaded! Help us by making sure that:
The context for this PR is clear, with relevant discussion, decisions and stakeholders linked/mentioned.
Your contribution itself is clear (code comments, self-review for the rest) and in its best form. Follow the code contribution guidelines if they apply.
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment. Next steps:
A maintainer will triage and assign priority to this PR, commenting on any missing things and potentially assigning a reviewer for high priority items.
The PR gets reviews, discussed and approvals as needed.
The PR is merged by maintainers when it has been approved and comments addressed.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. We are very grateful for your contribution!
Before continuing, what's your motivation? What issue did you observe?
The issue I observed was that I tried to run the installer, it failed to fetch the latest version and when I just straight up retried the exact same thing it did work. My motivation was to have the "meh I'll just try it again and see if it works now" already built in so that the odds of someone thinking the installer/ipfs in general is broken due to some random error would be at least a bit lower.
Instead of a "retries" option, it might make more sense to just have the HttpFetcher retry a few times with a short backoff (internally).
That definitely makes more sense, the reason I implemented it as an optional flag was so that the default behaviour could be kept as is if you preferred it that way, but the option would be there to change that behaviour if the user wanted it. Now that I think of it though, I can't really see a user using that setting without running into an error first.
edit: formatting (markdown is hard)
The issue I observed was that I tried to run the installer, it failed to fetch the latest version and when I just straight up retried the exact same thing it did work. My motivation was to have the "meh I'll just try it again and see if it works now" already built in so that the odds of someone thinking the installer/ipfs in general is broken due to some random error would be at least a bit lower.
Got it, makes sense. In that case, yeah, the retry logic definitely belongs in the HTTP Fetcher.
(closing this PR as the change will need to happen in https://github.com/ipfs/go-ipfs/blob/cd72589cfd41a5397bb8fc9765392bca904b596a/repo/fsrepo/migrations/httpfetcher.go)
Added a flag to the install command to set the amount of retries in case fetching the latest version or installing specified version fails (I currently set the default to 1 retry)