chore: update dependencies and adapt to updated crate APIs
Bumps core dependencies including ndarray, rand, hashbrown, niffler, ureq, sysinfo, indicatif, lru, and remove_dir_all. Adapts source code to accommodate breaking changes by migrating RNG initialization, adjusting HTTP response handling, and replacing the fs4 crate with standard library file locking. Adds a planning document for query benchmarking and sparse index regression tests.
This commit is contained in:
1 parent
32bcbd1465
commit
5a9d903e51
15 files changed
+365
-511
No files matched your search
@@ -5,7 +5,6 @@ edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
sysinfo = "0.33"
|
||||
indicatif = "0.17"
|
||||
sysinfo = "0.39"
|
||||
indicatif = "0.18"
|
||||
tracing = "0.1"
|
||||
fs4 = "0.9"
|
||||
@@ -11,9 +11,9 @@ use tracing::info;
|
||||
/// only needs to lock the destination.
|
||||
///
|
||||
/// Uses the OS's advisory file lock (`flock` on Unix, `LockFileEx` on
|
||||
/// Windows) via `fs4`, not a hand-rolled PID file: the OS releases it
|
||||
/// automatically on process exit, including a crash — no stale-lock cleanup
|
||||
/// logic needed.
|
||||
/// Windows) via `std::fs::File::lock`/`try_lock`, not a hand-rolled PID
|
||||
/// file: the OS releases it automatically on process exit, including a
|
||||
/// crash — no stale-lock cleanup logic needed.
|
||||
pub struct DirLock {
|
||||
_file: std::fs::File,
|
||||
}
|
||||
@@ -23,8 +23,6 @@ impl DirLock {
|
||||
/// and the lock file within it if needed). Logs once if the wait is
|
||||
/// non-trivial, so a blocked command doesn't look silently hung.
|
||||
pub fn acquire(dir: &std::path::Path) -> std::io::Result<Self> {
|
||||
use fs4::fs_std::FileExt;
|
||||
|
||||
std::fs::create_dir_all(dir)?;
|
||||
let lock_path = dir.join(".obikmer.lock");
|
||||
let file = std::fs::OpenOptions::new()
|
||||
@@ -33,9 +31,9 @@ impl DirLock {
|
||||
.write(true)
|
||||
.open(&lock_path)?;
|
||||
|
||||
if file.try_lock_exclusive().is_err() {
|
||||
if file.try_lock().is_err() {
|
||||
info!(dir = %dir.display(), "waiting for another obikmer process to release this index");
|
||||
file.lock_exclusive()?;
|
||||
file.lock()?;
|
||||
}
|
||||
Ok(Self { _file: file })
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user