Fix WAL flakiness on Windows (#254)

This commit is contained in:
Nuno Cruces
2025-03-26 10:17:19 +00:00
committed by GitHub
parent a67165eb09
commit 3547d9ffb0
3 changed files with 8 additions and 60 deletions

View File

@@ -60,10 +60,10 @@ func osLock(file *os.File, typ int16, start, len int64, timeout time.Duration, d
}
var err error
switch {
case timeout < 0:
err = unix.FcntlFlock(file.Fd(), unix.F_OFD_SETLKW, &lock)
default:
err = unix.FcntlFlock(file.Fd(), unix.F_OFD_SETLK, &lock)
case timeout < 0:
err = unix.FcntlFlock(file.Fd(), unix.F_OFD_SETLKW, &lock)
}
return osLockErrorCode(err, def)
}