Add reliable RemoveAll to handle racy situations (#6227)

This commit is contained in:
Harshavardhana
2018-08-05 21:15:28 -07:00
committed by Nitish Tiwari
parent 13fbb96736
commit 2dede2fdc2
4 changed files with 53 additions and 6 deletions

View File

@@ -64,7 +64,7 @@ func fsRemoveAll(ctx context.Context, dirPath string) (err error) {
return err
}
if err = os.RemoveAll(dirPath); err != nil {
if err = removeAll(dirPath); err != nil {
if os.IsPermission(err) {
logger.LogIf(ctx, errVolumeAccessDenied)
return errVolumeAccessDenied