Skip to content

Add --retries flag#2515

Closed
aawsome wants to merge 1 commit intorestic:masterfrom
aawsome:retries
Closed

Add --retries flag#2515
aawsome wants to merge 1 commit intorestic:masterfrom
aawsome:retries

Conversation

@aawsome
Copy link
Copy Markdown
Contributor

@aawsome aawsome commented Dec 15, 2019

What is the purpose of this change? What does it change?

Adds the new flag --retries to set the maximum number of retries for file operations.
If the number of retires is set higher than 20, restic will print out a warning.

Was the change discussed in an issue or in the forum before?

See issue #2504, first open point.
Closes #3223

Checklist

  • I have read the Contribution Guidelines
  • I have not added tests for all changes in this PR
  • I have added no documentation for the changes (in the manual)
  • There's a new file in changelog/unreleased/ that describes the changes for our users (template here)
  • I have run gofmt on the code in all commits
  • All commit messages are formatted in the same style as the other commits in the repo
  • I'm done, this Pull Request is ready for review

@aawsome
Copy link
Copy Markdown
Contributor Author

aawsome commented Jun 13, 2020

Is there anything that blocks this small change from getting merged?

@MichaelEischer
Copy link
Copy Markdown
Member

I'm not really sure about the design. Is it really the right way to blindly retry an operation lots of times?

One problem I see is that with infinite retries the shutdown of restic won't work properly in case of errors: e.g. removing a lock file might retry forever preventing restic from exiting. A similar behavior shows for other operations that can fail permanently.

@aawsome
Copy link
Copy Markdown
Contributor Author

aawsome commented Jun 14, 2020

I'm not really sure about the design. Is it really the right way to blindly retry an operation lots of times?

I do not question whether it is a good design to often retry or not. However, in the actual implementation restic retries 10 times and a specific total amount of time before giving up. As timings always can depend on the environment used, I would prefer to have user-definable setting with a sensible default value.

One problem I see is that with infinite retries the shutdown of restic won't work properly in case of errors: e.g. removing a lock file might retry forever preventing restic from exiting. A similar behavior shows for other operations that can fail permanently.

I agree that infinite trying is a bad idea. I propose the following:

  • only allow positive values to --retry
  • if the number is too large (e.g. > 20), print out a warning that restic may have to wait a long time to really quit in case of errors.

@aawsome
Copy link
Copy Markdown
Contributor Author

aawsome commented Jul 6, 2020

* only allow positive values to --retry

* if the number is too large (e.g. > 20), print out a warning that restic may have to wait a long time to really quit in case of errors.

This is now implemented.

Adds the new flag --retires to set the maximum number of retries
for file operations. Setting to -1 means infinite retry.
@aawsome
Copy link
Copy Markdown
Contributor Author

aawsome commented Jul 7, 2020

The warning message is now corrected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Limit number of retries especially for forget on append-only servers

2 participants