Add a --timeout flag to allow retrying operations for a longer time #830
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a
--timeout=<duration>
flag for most subcommands.Usage:
The timeout is not absolutely effective for all operations as the current version of rig does not support command timeouts (v2 does but migration #755 is still unfinished) and if a remote command hangs forever or past the timeout, it won't bite and abort the command, but instead keep waiting for it to finish.
If a timeout is not given, the pre-existing per step predefined (seems to always be either 30 seconds or 2 minutes) timeouts are be used and the functionality should remain the same.
If a timeout is given, each of those operations will be retried until the global timeout expires.
I'm not completely sure about naming it
--timeout
as it usually would imply that a long-running operation would be cut short when the time is exceeded, but in this case the use-case should more often seem to be to make it run longer than usual.While making this I realized there was already the
--retry-timeout ("Default timeout when waiting for node state changes")
flag that could have been used for some operations. It should probably be deprecated with the addition of--timeout
.