Skip to content

fix: keep the change when a storage write fails - #97

Merged
imurashka merged 1 commit into
mainfrom
ivan/keep-change-after-failed-save
Oct 6, 2026
Merged

imurashka merged 1 commit into
mainfrom
ivan/keep-change-after-failed-save

Conversation

@imurashka

Copy link
Copy Markdown
Contributor

The storage marked itself saved before the write, and the background writer only logged a failed write. So after a failed write, for example `File.Replace` while another process holds the backup file, `Dispose()` found nothing to save and the last change never reached the disk.

Now a failed write, on the background thread or on the calling one, leaves the storage counted as changed, and the next change, `Save()` or `Dispose()` writes the data again. The writer does not retry on its own.

@imurashka imurashka closed this Oct 6, 2026
@imurashka
imurashka deleted the ivan/keep-change-after-failed-save branch October 6, 2026 11:04
@imurashka
imurashka restored the ivan/keep-change-after-failed-save branch October 6, 2026 11:04
@imurashka imurashka reopened this Oct 6, 2026
@imurashka
imurashka force-pushed the ivan/keep-change-after-failed-save branch from a89d387 to 93601e4 Compare October 6, 2026 11:05
@imurashka
imurashka merged commit de5f9d9 into main Oct 6, 2026
2 checks passed
@imurashka
imurashka deleted the ivan/keep-change-after-failed-save branch October 6, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant