mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-11 03:38:07 +00:00
fix(lbug): skip the native close on the analyze error path too (#2264 review P2)
A real conn.close() on the error path after large --pdg writes can itself hit the LadybugDB ClientContext destructor double-free → SIGABRT, degrading an actionable exit-1 error into a raw native abort. Switch the error-path close to skipNativeClose (mirroring the success path). Safe now that the CLI catch force-exits when isLbugReady() (the prior commit): handles left open are reclaimed by that guaranteed process.exit, so the process terminates without the abort and without hanging. flushWAL keeps the partial index durable. Depends on the prior commit (CLI force-exit guard). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JBJomjoTdBV2eveDVq4JMm
This commit is contained in:
parent
8130e62586
commit
047530d077
1 changed files with 8 additions and 8 deletions
|
|
@ -1582,14 +1582,14 @@ export async function runFullAnalysis(
|
|||
/* swallow — surface path is the rethrow below */
|
||||
}
|
||||
try {
|
||||
// Real close on the error path — NOT skipNativeClose. The CLI error
|
||||
// handler soft-returns (process.exitCode = 1) instead of forcing exit, so
|
||||
// the native handles must be released here or the process would hang on the
|
||||
// live connection (#2264 review P1-2). A late-error close could still abort
|
||||
// in LadybugDB's destructor, but that terminates the process — it does not
|
||||
// hang. Only the success path (which guarantees a following process.exit)
|
||||
// skips the native close.
|
||||
await closeLbug();
|
||||
// Skip the native close on the error path too: a real conn.close() after
|
||||
// large --pdg writes can itself abort in LadybugDB's ClientContext
|
||||
// destructor (#2264 review P2), turning an actionable exit-1 into a raw
|
||||
// SIGABRT. Skipping leaves the handles open, but the CLI catch now
|
||||
// force-exits when isLbugReady() (analyze.ts, #2264 review P1), so the
|
||||
// process still terminates — no hang, no abort. flushWAL inside closeLbug
|
||||
// keeps the partial index durable; process exit reclaims the handles.
|
||||
await closeLbug({ skipNativeClose: options.skipNativeCloseOnExit });
|
||||
} catch {
|
||||
/* swallow */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue