Fix "Could not checkout. Do you have uncommitted changes?" error #1772
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.
In #1763 we added a new
Bootstrap
message handler to each Rally worker, which is responsible for ensuring the track and configuration is properly loaded on each worker before we attempt to execute the benchmark. Part of this work uncovered that there was a race condition if multiple workers tried to checkout the same underlying git repository in parallel, resulting in this error message:To avoid this, we added a check as part of the repository loading process that skips the checkout if we're already on the correct revision/branch
rally/esrally/track/loader.py
Lines 360 to 362 in 8dae2c3
However, recent PRs to https://github.com/elastic/rally-tracks have been failing due to this race condition even with the above check in place. When we look at the CI logs for an example of the failure, we see that it's because the revision passed in contains whitespace at the end, meaning the
correction_revision()
function returns false, note the whitespace in the latter revision:CI highlighted this bug, but it would be very confusing and difficult for any end users to debug.
This commit adds a function that strips whitespace from any subcommand
that takes a revision argument.