Skip to content

Commit

Permalink
Tolerate file deletion race on CurrentShadowWALIndex (benbjohnson#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
hifi authored Dec 19, 2023
1 parent 676810c commit dae4f6e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,9 @@ func (db *DB) CurrentShadowWALIndex(generation string) (index int, size int64, e
// Find highest wal index.
for _, de := range des {
fi, err := de.Info()
if err != nil {
if os.IsNotExist(err) {
continue // file was deleted after os.ReadDir returned
} else if err != nil {
return 0, 0, err
}

Expand Down

0 comments on commit dae4f6e

Please sign in to comment.