mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-29 06:32:28 +00:00
fix: remove unconditional embedder import from disconnect() to prevent crash on Node v24+
The disconnect() method was unconditionally importing embedder.js on every graceful shutdown, which loads @huggingface/transformers and onnxruntime-node — triggering the exact crash this branch fixes. Since process.exit(0) follows immediately, the OS reclaims all resources without needing disposeEmbedder(). Matches the pattern already established in analyze.ts (lines 318-320). Fixes #89 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0f91e943e7
commit
52ae5ba851
1 changed files with 5 additions and 2 deletions
|
|
@ -1592,8 +1592,11 @@ export class LocalBackend {
|
|||
|
||||
async disconnect(): Promise<void> {
|
||||
await closeKuzu(); // close all connections
|
||||
const { disposeEmbedder } = await import('../core/embedder.js');
|
||||
await disposeEmbedder();
|
||||
// Note: we intentionally do NOT call disposeEmbedder() here.
|
||||
// ONNX Runtime's native cleanup segfaults on macOS and some Linux configs,
|
||||
// and importing the embedder module on Node v24+ crashes if onnxruntime
|
||||
// was never loaded during the session. Since process.exit(0) follows
|
||||
// immediately after disconnect(), the OS reclaims everything. See #38, #89.
|
||||
this.repos.clear();
|
||||
this.contextCache.clear();
|
||||
this.initializedRepos.clear();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue