fix(core): await secrets store close during TaskStore shutdown

This commit is contained in:
Phil Larson
2026-06-29 12:36:52 -07:00
committed by gsxdsm
parent d7f26bb6cf
commit 90756f92b0
2 changed files with 17 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
---
"@runfusion/fusion": patch
---
summary: Wait for task store secret database handles to close before cleanup.
category: fix
dev: Awaits the async secrets store close path during TaskStore shutdown to avoid teardown races.

View File

@@ -16135,8 +16135,17 @@ ${stepsSection}`;
this._archiveDb = null;
}
if (this.secretsCentralCore) {
void this.secretsCentralCore.close();
// Await the secrets central core close: CentralCore.close() is async, so a
// fire-and-forget call would let close() resolve while the secrets SQLite
// handle is still draining on a later microtask, racing temp-root cleanup
// under the loaded package test lane. Await it like the other handles above.
const secretsCentralCore = this.secretsCentralCore;
this.secretsCentralCore = null;
try {
await secretsCentralCore.close();
} catch (err) {
console.warn(`[fusion] Could not close secrets central core on TaskStore close:`, err);
}
}
this.secretsStore = null;
if (this.pluginStore) {