From 69be0efe28ed7f62f1168e7318d820b3260385a0 Mon Sep 17 00:00:00 2001 From: Jayant Date: Wed, 21 May 2025 07:43:26 +0530 Subject: [PATCH] Update rustix+fs4 dependency --- Cargo.toml | 4 ++-- src/lib.rs | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3865184..8499e59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,10 +19,10 @@ log = "0.4" memmap2 = "0.9.4" rand = "0.9" rand_distr = "0.5" -fs4 = "0.12.0" +fs4 = "0.13.1" # fs4 depends on rustix, but pulling this dependency explicitly into the tree # to use direct functions on FreeBSD -rustix = { version = "0", features = [ "fs" ]} +rustix = { version = "1", features = [ "fs" ]} crossbeam-channel = "0.5" # Binary dependencies diff --git a/src/lib.rs b/src/lib.rs index 35b59fa..8833df3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -142,7 +142,9 @@ impl Wal { dir }; - dir.try_lock_exclusive()?; + if !dir.try_lock_exclusive()? { + return Err(fs4::lock_contended_error()); + } // Holds open segments in the directory. let mut open_segments: Vec = Vec::new();