v0.20.5: NFS-aware writeback + bounded sync_file_range timeout
Targets the recurring mux hang on NFS dest where the consumer thread sits indefinitely inside libc::sync_file_range(SYNC_FILE_RANGE_WAIT_AFTER) because the NFS server never returns a commit ack. The whole rip wedges; halt is cooperative and can't reach inside a kernel syscall. A. NFS detection at WritebackPipeline construction (fstatfs f_type == NFS_SUPER_MAGIC 0x6969). When NFS: - Skip SYNC_FILE_RANGE_WAIT_AFTER entirely. - Skip posix_fadvise(DONTNEED) — NFS client handles its own buffering. - Still issue async SYNC_FILE_RANGE_WRITE (harmless hint). Cannot hang on a syscall not made. fstatfs failure fails open (assume local). Logged at info on construction so operators see which strategy is active. The whole hang vector is removed for NFS deployments. B. Hard timeout on WAIT_AFTER for non-NFS (defense in depth, since even a degraded local disk could in principle hang the syscall). Each WAIT_AFTER runs on a worker thread; main thread waits on a sync_channel rendezvous with 30s deadline. On timeout: log error, set per-pipeline 'degraded' Arc<AtomicBool>, downgrade to NFS-style skip for the rest of the pipeline's life. Worker thread leaks intentionally — it'll unwind when the syscall eventually returns or the process exits. Converts indefinite freeze into 'log loud + downgrade + keep ripping'. C. Diagnostic logging for the 73%-of-this-movie reproduction: - WritebackFile::seek logs every non-trivial seek (from, to, signed delta) at target=mux so we can see if MkvMuxer seeks back before a stall. - WritebackPipeline::finalize logs the chunk being finalised before any WAIT_AFTER call, so a hung chunk is identifiable by offset. No new dependencies. macOS / Windows noop stubs unchanged. Net +198 LOC libfreemkv (mostly writeback/linux.rs).
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "libfreemkv"
|
||||
version = "0.20.4"
|
||||
version = "0.20.5"
|
||||
edition = "2024"
|
||||
rust-version = "1.86"
|
||||
license = "AGPL-3.0-only"
|
||||
|
||||
Reference in New Issue
Block a user