Snapshotter cleanup fix - #18
Merged
Merged
Conversation
ambarve
force-pushed
the
sn_cleanup_fix
branch
2 times, most recently
from
June 3, 2021 23:40
9354c1d to
b6eb875
Compare
msscotb
requested changes
Jun 4, 2021
During snapshotter cleanup lcow/wcow snapshotters try to rename the snapshot directory before cleaning it up. This rename operation sometimes fails if the sandbox.vhdx file inside that directory is still open in some process (ideally it should not be open but can stay open in case of a crash or exception) or if the directory is busy for some other reason. However, if this rename operation fails we return that error and then the entire snapshot garbage collection operation fails. Due to this we end up not cleaning other snapshots which otherwise could have been cleaned up without any errors. If this goes on for a long time we will end up filling the entire disk with stale snapshots. This change fixes that issue by continuing the snapshot cleanup if the rename operation fails because of such open handles. Signed-off-by: Amit Barve <ambarve@microsoft.com>
dcantah
approved these changes
Jun 8, 2021
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.
During snapshotter cleanup lcow/wcow snapshotters try to rename the snapshot directory
before cleaning it up. This rename operation sometimes fails if the sandbox.vhdx file
inside that directory is still open in some process (ideally it should not be open but can
stay open in case of a crash or exception). However, if this rename operation fails we
return that error and then the entire snapshot garbage collection operation fails. Due to
this we end up no cleaning other snapshots which otherwise could have been cleaned up
without any errors. If this goes on for a long time we will end up filling the entire disk
with stale snapshots. This change fixes that issues by continuing the snapshot cleanup if
the rename operation fails because of such open handles.
Signed-off-by: Amit Barve ambarve@microsoft.com