fix: treat unconfirmed cache dir-fsync as a warning, not a save failure#100
Closed
cplieger wants to merge 1 commit into
Closed
fix: treat unconfirmed cache dir-fsync as a warning, not a save failure#100cplieger wants to merge 1 commit into
cplieger wants to merge 1 commit into
Conversation
atomicfile now returns *WriteError{PhaseDirSync} when the parent-directory
fsync fails after a successful rename. cache.json is reconstructible (it is
rebuilt from Plex on the next run), so a durability-only failure should not fail
the cache write. SaveTo now logs a warning and returns nil on PhaseDirSync,
while still propagating genuine write failures.
Depends on atomicfile v1.1.0 (PhaseDirSync). CI is red until Renovate bumps the
atomicfile dependency after that release; merge only after the bump lands.
Owner
Author
|
Moved the cache dir-fsync durability fix into #108 (Library adoption) via cherry-pick. Closing in favor of that PR. |
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.
Summary
atomicfile now returns
*WriteError{Phase: PhaseDirSync}when the parent-directory fsync fails after a successful rename: the cache is written, only its durability across an immediate crash is unconfirmed.cache.jsonis reconstructible (it is rebuilt from Plex on the next run), so a durability-only failure should not fail the whole cache write.Cache.SaveTonow logs a warning and returnsnilonPhaseDirSync, while still propagating genuine write failures.Dependency / merge order
Depends on atomicfile v1.1.0 (the
PhaseDirSyncAPI). CI will be red here until Renovate bumps theatomicfiledependency after that release. Merge only after the go.mod bump lands.