mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-10 03:27:59 +00:00
fix(embeddings): also dispose ONNX session on error path
If the embedding pipeline throws mid-run, the outer catch block only closed LadybugDB but left the ONNX Runtime session alive. Dispose it before closeLbug to prevent the same atexit race on the error path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ddbfa838ca
commit
82035d6b6a
1 changed files with 8 additions and 1 deletions
|
|
@ -354,7 +354,14 @@ export async function runFullAnalysis(
|
|||
pipelineResult,
|
||||
};
|
||||
} catch (err) {
|
||||
// Ensure LadybugDB is closed even on error
|
||||
// Ensure native resources are closed even on error to prevent
|
||||
// C++ atexit destructor races during process.exit() (#38, #40).
|
||||
try {
|
||||
const { disposeEmbedder } = await import('./embeddings/embedder.js');
|
||||
await disposeEmbedder();
|
||||
} catch {
|
||||
/* swallow */
|
||||
}
|
||||
try {
|
||||
await closeLbug();
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue