feat(FN-4083): add WAL enforcement, immediate write transactions, and concu
Hardened SQLite concurrent-write safety in `@fusion/core` by auditing WAL enforcement and adding immediate write transactions to prevent stale reads under load, with executor semaphore limit tests in `@fusion/engine` validating the concurrency bounds; added a new `store-concurrent-writes.test.ts` in Fusion-Task-Id: FN-4083 Fusion-Task-Lineage: adabe51a-a9c4-481a-850d-985c373df51a
This commit is contained in:
@@ -1740,7 +1740,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
task: Task,
|
||||
auditInput?: RunAuditEventInput,
|
||||
): Promise<void> {
|
||||
this.db.transaction(() => {
|
||||
this.db.transactionImmediate(() => {
|
||||
// Upsert the task
|
||||
this.upsertTaskWithFtsRecovery(task);
|
||||
|
||||
@@ -4137,7 +4137,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
||||
metadata: input.metadata,
|
||||
};
|
||||
|
||||
this.db.transaction(() => {
|
||||
this.db.transactionImmediate(() => {
|
||||
this.db.prepare(`
|
||||
INSERT INTO runAuditEvents (
|
||||
id, timestamp, taskId, agentId, runId, domain, mutationType, target, metadata
|
||||
|
||||
Reference in New Issue
Block a user