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
Add a global option --retry-lock #4107
Conversation
17ff0e4
to
00704b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR needs a few more tweaks, but it's already in a good shape.
790e4b4
to
8121549
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Please squash the commits.
I wonder whether the timing checks in the tests might be too strict or not. But we can fix that if it turns out to be a problem.
5dfa011
to
95a7f0f
Compare
Fixes restic#719 If the option is passed, restic will wait the specified duration of time and retry locking the repo every 10 seconds (or more often if the total timeout is relatively small). - Play nice with json output - Reduce wait time in lock tests - Rework timeout last attempt - Reduce test wait time to 0.1s - Use exponential back off for the retry lock - Don't pass gopts to lockRepo functions - Use global variable for retry sleep setup - Exit retry lock on cancel - Better wording for flag help - Reorder debug statement - Refactor tests - Lower max sleep time to 1m - Test that we cancel/timeout in time - Use non blocking sleep function - Refactor into minDuration func Co-authored-by: Julian Brost <julian@0x4a42.net>
95a7f0f
to
ea59896
Compare
|
Hmm, it looks like the durations checks are too strict: I've broadened them quite a bit, but I fear these might become another |
fcf3c02
to
8ce5f29
Compare
Attempt to resurrect #2214
What does this PR change? What problem does it solve?
If the option is passed, restic will wait the specified duration of time and retry locking the repo every 10 seconds (or more often if the total timeout is relatively small).
Was the change previously discussed in an issue or on the forum?
Fixes #719
Checklist
changelog/unreleased/
that describes the changes for our users (see template).gofmt
on the code in all commits.