Harden concurrency and resource lifecycle (#101)
Some checks failed
Native code generation / deterministic (push) Failing after 2m4s
Concurrency and resource soak audit / soak (push) Failing after 6m31s
Imaging and meshing gate / native (push) Failing after 2m52s
JPEG 2000 feature / linux (push) Successful in 2m45s
Release platform and feature matrix / audit (push) Successful in 35s
Native Rust workspace compile / compile (push) Failing after 54s
Release platform and feature matrix / matrix (false, linux-stable-minimal, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, macos-stable-portable, x86_64-apple-darwin, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (false, windows-stable-portable, x86_64-pc-windows-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-msrv-portable, x86_64-unknown-linux-gnu, 1.96.0) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-default, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-features, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Release platform and feature matrix / matrix (true, linux-stable-release-surface, x86_64-unknown-linux-gnu, stable) (push) Has been cancelled
Dependency and supply-chain audit / audit (push) Has been cancelled
Skia feature / linux (push) Has been cancelled

This commit is contained in:
2026-08-11 23:39:05 +00:00
parent 9e3b532a7e
commit 3db144da63
17 changed files with 1217 additions and 23 deletions

View File

@@ -774,6 +774,35 @@ impl fmt::Debug for InventoryManager {
}
impl InventoryManager {
/// Whether the manager's callback-expiry worker is still owned and may run.
#[must_use]
pub fn cleanup_worker_running(&self) -> bool {
mutex(&self.inner.cleanup_worker).is_some()
}
/// Total asynchronous inventory operations still awaiting a reply.
#[must_use]
pub fn pending_operation_count(&self) -> usize {
mutex(&self.inner.pending_created).len()
+ mutex(&self.inner.pending_copied).len()
+ mutex(&self.inner.pending_fetches)
.values()
.map(Vec::len)
.sum::<usize>()
+ mutex(&self.inner.pending_task_replies)
.values()
.map(Vec::len)
.sum::<usize>()
+ mutex(&self.inner.pending_offers).len()
+ mutex(&self.inner.task_xfers).len()
}
/// Whether deterministic manager teardown has completed.
#[must_use]
pub fn is_disposed(&self) -> bool {
self.inner.disposed.load(Ordering::Acquire)
}
pub(crate) fn native_from_inner(inner: Arc<InventoryManagerInner>) -> Self {
Self { inner }
}