Merge pull request #2212 from dmcgowan/fix-overlay-cleanup-race
overlay: fix cleanup directory deletion race
This commit is contained in:
commit
3c1ef1a714
@ -309,7 +309,9 @@ func (o *snapshotter) Cleanup(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *snapshotter) cleanupDirectories(ctx context.Context) ([]string, error) {
|
func (o *snapshotter) cleanupDirectories(ctx context.Context) ([]string, error) {
|
||||||
ctx, t, err := o.ms.TransactionContext(ctx, false)
|
// Get a write transaction to ensure no other write transaction can be entered
|
||||||
|
// while the cleanup is scanning.
|
||||||
|
ctx, t, err := o.ms.TransactionContext(ctx, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user