feat: bulk command resiliency improvements #220
Merged
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.
This change makes some relatively minor changes to help with bulk command resiliency, particularly around the management of the bulk checkout state when dealing with partial failures and killed commands. Combined with #219 retries & timeouts this should now be resilient against HTTP 502 Bad Gateway and HTTP 429 Too Many Requests from rate limiting, as well as HTTP 422 Unprocessable Content on pushes which fail validation, leaving the metadata state in a reasonable place for subsequent commands.
Note that it's still possible to kill the commands mid-run, but rather than having many files not match their metadata you should now e.g. be able to safely kill pulls and pushes with no ill effects or with just one file showing as modified because a write was in progress while it was killed. This is much easier to fix up with a reset than previously.
Specifically, this PR does the following: