Merge pull request #23587 from rhatdan/errors

Additional potential race condition on os.Readdir
This commit is contained in:
openshift-merge-bot[bot]
2024-08-13 10:04:59 +00:00
committed by GitHub

View File

@ -1,7 +1,9 @@
package file
import (
"errors"
"fmt"
"io/fs"
"os"
"path/filepath"
"strconv"
@ -138,7 +140,9 @@ func (locks *FileLocks) DeallocateAllLocks() error {
p := filepath.Join(locks.lockPath, f.Name())
err := os.Remove(p)
if err != nil {
lastErr = err
if errors.Is(err, fs.ErrNotExist) {
continue
}
logrus.Errorf("Deallocating lock %s", p)
}
}