spindb 0.26.1 → 0.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/engines/cockroachdb/index.ts +10 -2
- package/package.json +1 -1
|
@@ -282,8 +282,16 @@ export class CockroachDBEngine extends BaseEngine {
|
|
|
282
282
|
await writeFile(pidFile, proc.pid.toString(), 'utf-8')
|
|
283
283
|
logDebug(`Wrote PID file: ${pidFile} (pid: ${proc.pid})`)
|
|
284
284
|
} catch (err) {
|
|
285
|
-
|
|
286
|
-
//
|
|
285
|
+
// PID file write failed - kill the process and fail fast
|
|
286
|
+
// Without the PID file, we can't stop the container later
|
|
287
|
+
const errMsg = `Failed to write PID file: ${err instanceof Error ? err.message : String(err)}`
|
|
288
|
+
logDebug(errMsg)
|
|
289
|
+
try {
|
|
290
|
+
process.kill(proc.pid, 'SIGTERM')
|
|
291
|
+
} catch {
|
|
292
|
+
// Process may have already exited
|
|
293
|
+
}
|
|
294
|
+
throw new Error(errMsg)
|
|
287
295
|
}
|
|
288
296
|
}
|
|
289
297
|
|