Merge pull request #17006 from sujalshah-bit/fix_wal_dir_bug

wal: ignore os.ErrNotExist errors in DirSize during WAL size calculation
This commit is contained in:
Bartlomiej Plotka 2025-08-06 10:40:02 +01:00 committed by GitHub
commit 291e2ae090
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,10 @@ func DirSize(dir string) (int64, error) {
var size int64
err := filepath.Walk(dir, func(_ string, info os.FileInfo, err error) error {
if err != nil {
// Ignore missing files that may have been deleted during the walk.
if os.IsNotExist(err) {
return nil
}
return err
}
if !info.IsDir() {