Repository navigation
fix: make durability fsync portable on Windows - #222
Merged
Merged
Conversation
Windows rejects fsync on read-only database and journal handles with EPERM. Open application-owned durability targets read-write before flushing them so pre-migration backups and replacement journals work on Windows without weakening the fail-closed durability check.
Contributor
Author
|
Manual full cross-platform validation completed: workflow run 31291071323 passed on Windows, Ubuntu, macOS x64, and macOS arm64. The original post-merge failure was Windows-only |
9 tasks
Contributor
Author
Final validationConfirmed locally on
Online PR checks are all green. The manually dispatched full cross-platform matrix (run |
khaira777
added a commit
that referenced
this pull request
Aug 9, 2026
Make the database maintenance concurrency regression test deterministic across platforms. The Windows full cross-platform matrix exposed a race where the test relied on a 1ms delay to assume a maintenance lock had started. The request could arrive before the lock became active and incorrectly receive 200 instead of 503. This test-only change waits for the existing maintenance-start listener signal before issuing the concurrent request, then unregisters the listener during cleanup. Verification: - npm run build - maintenance-lock test passed - 20 repeated maintenance-lock runs passed - All PR checks passed This restores deterministic full-suite behavior after the Windows follow-up in PR #222.
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.
Problem
The post-merge Full Cross-Platform Matrix failed only on Windows during the smoke test.
fs.fsyncSync()was called on a read-only (r) file descriptor and Windows returnedEPERMwhile creating the pre-migration backup.Fix
Open application-owned database, journal, and backup files with
r+before fsync. This preserves the fail-closed durability check and avoids weakening recovery guarantees.Verification
npm run buildnpm run test:backupnpm run test:recovery-cloudtests/smoke-test.test.tsThis is a follow-up to merged PR #217 and should be reviewed independently. It addresses the Windows CI failure at run https://github.com/FreeOpenSourcePOS/FloCafe/actions/runs/31290095061.