fix(processmanager): Improve process lifecycle handling and cleanup in daemon, monitors and wrappers

This commit is contained in:
2025-08-31 07:45:47 +00:00
parent 8f31672a67
commit 0a75c4cf76
6 changed files with 56 additions and 32 deletions

View File

@@ -400,6 +400,11 @@ export class ProcessMonitor extends EventEmitter {
if (this.intervalId) {
clearInterval(this.intervalId);
}
// Cancel any pending restart timer
if (this.restartTimer) {
clearTimeout(this.restartTimer);
this.restartTimer = null;
}
if (this.processWrapper) {
// Clear pidusage state for current PID before stopping to avoid leaks
try {