Windows install round 4: PGlite 0.5.4 + quarantine of partially-initialized data directories - #10
Merged
Conversation
…artially-initialized data dirs The self-diagnosing installer surfaced the real error: PGlite WASM Aborted() on every disk-mode open. Root cause (electric-sql/pglite#794): the round-2 crashed build workers left data\pglite PARTIALLY INITIALIZED, and a poisoned data dir aborts every subsequent open — the absolute-path change couldn't help because the directory itself was corrupt. - @electric-sql/pglite ^0.3.16 -> ^0.5.4: adds NodeFS data-directory locking (prevents the multi-instance corruption class entirely, electric-sql/pglite#892) and fails with a clear message instead of a WASM abort when a dir is unusable. Smoke/tests/build green on 0.5.4 with drizzle 0.45 - Embedded driver now QUARANTINES a non-empty data dir that lacks the markers of a completed initialization (PG_VERSION + postgresql.conf): moved aside as <dir>.corrupt-<timestamp> — never deleted — and the engine initializes fresh. Verified end-to-end: a deliberately corrupted dir recovers, real data dirs are untouched Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014iDzjNAoM7NyKUorQ11wro
dchevalier18
marked this pull request as ready for review
July 12, 2026 14:59
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
The self-diagnosing installer did its job — the log excerpt identified the real root cause of every runtime 500 since round 2.
Root cause
electric-sql/pglite#794: a PGlite data directory left partially initialized by a crashed instance aborts every subsequent open with
RuntimeError: Aborted(). The round-2 crashed build workers poisoneddata\pgliteon the test machine, and every retest since has been opening that same corrupted directory — which is why the absolute-path change didn't help.Changes
@electric-sql/pglite^0.3.16→^0.5.4— adds NodeFS data-directory locking (#892), which prevents this corruption class entirely, and fails with a clear message instead of a WASM abort when a directory is unusable. Smoke, 69 tests, and the production build are green on 0.5.4 with drizzle 0.45.PG_VERSION+postgresql.conf) is moved aside as<dir>.corrupt-<timestamp>— never deleted — and the engine initializes fresh. Verified end-to-end: a deliberately corrupted directory recovers automatically; healthy directories are untouched.Windows retest after merge
(Keep
.env.localthis time — the absolute path in it is correct.)🤖 Generated with Claude Code
https://claude.ai/code/session_014iDzjNAoM7NyKUorQ11wro
Generated by Claude Code