fix(core): prevent concurrent startup database failures (#2330)
## Summary Concurrent PostgreSQL project initialization no longer causes transient dashboard failures, including repeated `GET /api/remote/status` 500 responses. The failure was a database deadlock between project-row identity promotion and schema/plugin DDL, which previously acquired overlapping locks in inconsistent orders. This establishes one advisory-lock order across SQLite cutover, project identity promotion, and schema mutations. Focused regression coverage proves schema DDL waits behind an active migration transaction and that identity stamping acquires the migration lock before reading project-owned tables. ## Validation - 25 focused unit tests passed. - 3 focused real-PostgreSQL regression tests passed. - `@fusion/core` typecheck passed. - Strict changeset validation passed. - Fast workspace verification passed, including the CLI build and boot health check. --- [](https://github.com/EveryInc/compound-engineering-plugin) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Prevented transient dashboard failures caused by PostgreSQL startup and migration deadlocks. * Improved serialization when multiple projects initialize or update database schemas concurrently. * Ensured migration state updates and schema changes occur in a consistent order. * **Tests** * Added coverage for migration lock ordering, concurrent schema operations, and recovery after lock contention. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
7
.changeset/fix-postgres-startup-migration-deadlock.md
Normal file
7
.changeset/fix-postgres-startup-migration-deadlock.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
summary: Prevent transient dashboard failures when multiple projects initialize PostgreSQL concurrently.
|
||||
category: fix
|
||||
dev: Uses one advisory-lock order for schema DDL, SQLite cutover, and project identity promotion.
|
||||
Reference in New Issue
Block a user