fix(core): don't abort backup on dataless cloud-only directories#184
Open
hexsprite wants to merge 1 commit into
Open
fix(core): don't abort backup on dataless cloud-only directories#184hexsprite wants to merge 1 commit into
hexsprite wants to merge 1 commit into
Conversation
On macOS, calling read_dir on a FileProvider dataless (iCloud cloud-only)
directory blocks fileproviderd trying to materialize the listing and
returns EDEADLK ("Resource deadlock avoided", os error 11). That error
propagated up and aborted the entire backup — no snapshot was written.
Skip descent into stat-detected dataless directories (record the dir
inode for restore, but never read_dir into it), mirroring the existing
dataless-file skip path. Also soft-classify EDEADLK on macOS in
is_soft_backup_io_error to cover the race where a directory flips
dataless between lstat and read_dir. Scoped to macOS so genuine
fcntl/flock deadlocks are not masked elsewhere.
Adds regression tests for the descent decision (should_descend_into_dir)
and the EDEADLK classification, both polarities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #183.
Problem
On macOS,
std::fs::read_diron a FileProvider dataless (iCloud cloud-only) directory blocksfileproviderdand returnsEDEADLK—"Resource deadlock avoided" (os error 11). The walker treated that as fatal, so a single cloud-only directory aborted the entire backup (exit 1, no snapshot). A nightly backup silently stopped producing snapshots for weeks because of this.stat/lstaton a dataless inode succeeds instantly; only descent (read_dir) deadlocks — so the walker sails through the stat but dies the moment it tries to list the directory.Fix
should_descend_into_dir(actual_is_dir, is_symlink, is_dataless)inwalk/mod.rs. The directory inode is still recorded (restore recreates it); its cloud-only children are skipped — mirroring the existing dataless-file skip path.is_datalesswas already onMetadataSummary; it just wasn't consulted before descending.EDEADLKon macOS inis_soft_backup_io_error, covering the race where a directory flips dataless betweenlstatandread_dir. Scoped#[cfg(target_os = "macos")]so genuinefcntl/flockdeadlocks are not masked on other platforms.Tests
should_descend_into_dir— normal dir descends; dataless dir does not; symlink-dir does not; file does not.is_soft_backup_io_error— errno 11 is soft on macOS, not soft on other unix.make pre-commitclean (fmt + clippy-D warnings+ doc-check + tests).Verified in production
Full
vykar backup -R r2on the affected machine: snapshot created, 923,725 files, 0 deadlocks, 48,090 dataless files soft-skipped and tallied. First successful snapshot in weeks.Per CONTRIBUTING, this is filed against triaged issue #183 — happy to adjust approach if you'd prefer a different design before merge.