GitMaintenanceStep: Throw if stopped while Git is running#1072
Merged
derrickstolee merged 2 commits intomicrosoft:masterfrom Apr 26, 2019
Merged
GitMaintenanceStep: Throw if stopped while Git is running#1072derrickstolee merged 2 commits intomicrosoft:masterfrom
derrickstolee merged 2 commits intomicrosoft:masterfrom
Conversation
jeschu1
reviewed
Apr 26, 2019
The GitMaintenanceStep throws a StoppingException if the RunGitCommand() method is run after a Stop() call. However, it doesn't throw when the Stop() call happens during the Git process. This requires extra handling of the Stopping boolean after receiving a response from RunGitCommand(). The better thing to do is to throw the StoppingException after the Git process completes. Add a unit test that verifies we automatically skip the remainder of a PerformMaintenance() method in a subclass. Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
95e4705 to
2269bef
Compare
kewillford
approved these changes
Apr 26, 2019
Member
kewillford
left a comment
There was a problem hiding this comment.
Approved with one suggestion.
wilbaker
approved these changes
Apr 26, 2019
The GitMaintenanceStepTests have three subclasses of GitMaintenanceStep to invoke the Stop() method at different times and report which blocks were reached. Instead, use an enum to specify when we should call Stop() and use the same subclass in all methods. Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The GitMaintenanceStep throws a StoppingException if the
RunGitCommand() method is run after a Stop() call. However,
it doesn't throw when the Stop() call happens during the
Git process. This requires extra handling of the Stopping
boolean after receiving a response from RunGitCommand().
Such extra handling was added in #1064, but would not
be necessary with this change.
The better thing to do is to throw the StoppingException
after the Git process completes.
Add a unit test that verifies we automatically skip the
remainder of a PerformMaintenance() method in a subclass.
Looking through the error logs, all logged instances of a
failure during 'commit-graph verify' or 'multi-pack-index verify'
are actually due to this issue. Otherwise we would see errors
from GitMaintenanceStep saying "Git process {command} failed with errors:"
and those messages do no appear in the logs.