Skip to content

Commit f34fef8

Browse files
author
Lasim
committed
feat(satellite): add uninstall shutdown handling to skip crash detection
1 parent 785b73c commit f34fef8

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

services/satellite/src/process/manager.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,19 @@ export class ProcessManager extends EventEmitter {
8686
return;
8787
}
8888

89+
// Check if this is an intentional uninstall shutdown (skip crash detection)
90+
if (processInfo.isUninstallShutdown) {
91+
this.logger.info({
92+
operation: 'process_exit_uninstall',
93+
installation_name: installationName,
94+
team_id: processInfo.config.team_id,
95+
exit_code: code,
96+
signal: signal,
97+
uptime_ms: uptime
98+
}, `Process terminated for uninstall (not a crash): ${installationName}`);
99+
return;
100+
}
101+
89102
// Determine if this was a crash (non-zero exit code) or intentional shutdown
90103
const wasCrash = code !== 0 && code !== null && processInfo.status !== 'terminating';
91104

@@ -471,6 +484,9 @@ export class ProcessManager extends EventEmitter {
471484
status: processInfo.status
472485
}, `Terminating active process: ${installationName}`);
473486

487+
// Mark as intentional uninstall shutdown to skip crash detection
488+
processInfo.isUninstallShutdown = true;
489+
474490
await this.terminateProcess(processInfo, timeout);
475491
result.active = true;
476492
}

services/satellite/src/process/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export interface ProcessInfo {
5656
errorCount: number; // Total errors encountered
5757
activeRequests: Map<string, PendingRequest>; // Pending JSON-RPC requests
5858
isDormantShutdown?: boolean; // Flag for intentional idle termination (skip crash detection)
59+
isUninstallShutdown?: boolean; // Flag for intentional uninstall termination (skip crash detection)
5960
}
6061

6162
/**

0 commit comments

Comments
 (0)