Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
25439: backport-2.0: engine: actually unlock temp dirs on Windows r=bdarnell a=tschottdorf Backport 1/1 commits from cockroachdb#25267. /cc @cockroachdb/release --- File locks are mandatory on Windows; our cleanup code was previously assuming file system locks were advisory. Specifically, our cleanup code was locking the temporary directory, then attempting to remove it before releasing the lock. This worked on Unix platforms where locks are advisory-only, but failed on Windows because the process's own lock would prevent the cleanup! Presumably this ordering was meant to avoid a race condition where the directory was unlocked before it was cleaned up. It turns out this race condition doesn't matter (see the comment within), so just unlock the directory before removing it, which works on both Unix and Windows. Release note (bug fix): Restarting a CockroachDB server on Windows no longer fails due to file system locks in the store directory. Fix cockroachdb#24144. Fix cockroachdb#25272. Co-authored-by: Nikhil Benesch <[email protected]>
- Loading branch information