mirror of
https://github.com/stablyai/orca.git
synced 2026-10-16 00:03:09 +00:00
Suppress recoverable child process crash prompts
This commit is contained in:
@@ -143,6 +143,24 @@ describe('shouldRecordProcessGoneCrash', () => {
|
||||
expectedTeardown: 'none'
|
||||
})
|
||||
).toBe(false)
|
||||
expect(
|
||||
shouldRecordProcessGoneCrash({
|
||||
source: 'child',
|
||||
processType: 'GPU',
|
||||
reason: 'abnormal-exit',
|
||||
exitCode: 512,
|
||||
expectedTeardown: 'none'
|
||||
})
|
||||
).toBe(false)
|
||||
expect(
|
||||
shouldRecordProcessGoneCrash({
|
||||
source: 'child',
|
||||
processType: 'GPU',
|
||||
reason: 'abnormal-exit',
|
||||
exitCode: 8704,
|
||||
expectedTeardown: 'none'
|
||||
})
|
||||
).toBe(false)
|
||||
expect(
|
||||
shouldRecordProcessGoneCrash({
|
||||
source: 'child',
|
||||
@@ -163,6 +181,26 @@ describe('shouldRecordProcessGoneCrash', () => {
|
||||
expectedTeardown: 'none'
|
||||
})
|
||||
).toBe(false)
|
||||
expect(
|
||||
shouldRecordProcessGoneCrash({
|
||||
source: 'child',
|
||||
processType: 'Utility',
|
||||
serviceName: 'audio.mojom.AudioService',
|
||||
reason: 'killed',
|
||||
exitCode: 1,
|
||||
expectedTeardown: 'none'
|
||||
})
|
||||
).toBe(false)
|
||||
expect(
|
||||
shouldRecordProcessGoneCrash({
|
||||
source: 'child',
|
||||
processType: 'Utility',
|
||||
serviceName: 'audio.mojom.AudioService',
|
||||
reason: 'crashed',
|
||||
exitCode: -1,
|
||||
expectedTeardown: 'none'
|
||||
})
|
||||
).toBe(false)
|
||||
})
|
||||
|
||||
it('still records unknown child process crashes', () => {
|
||||
|
||||
@@ -3,8 +3,11 @@ export type ExpectedTeardownScope = 'none' | 'renderer-reload' | 'app-shutdown'
|
||||
|
||||
const WINDOWS_CONTROL_TERMINATION_EXIT_CODES = new Set([0xc000013a, 0x40010004])
|
||||
const RECOVERABLE_CHILD_PROCESS_TYPES = new Set(['gpu'])
|
||||
const RECOVERABLE_UTILITY_SERVICE_NAMES = new Set(['network.mojom.NetworkService'])
|
||||
const RECOVERABLE_CHILD_PROCESS_REASONS = new Set(['crashed', 'killed'])
|
||||
const RECOVERABLE_UTILITY_SERVICE_NAMES = new Set([
|
||||
'audio.mojom.AudioService',
|
||||
'network.mojom.NetworkService'
|
||||
])
|
||||
const RECOVERABLE_CHILD_PROCESS_REASONS = new Set(['abnormal-exit', 'crashed', 'killed'])
|
||||
|
||||
function isWindowsControlTerminationExitCode(exitCode: number | null): boolean {
|
||||
if (exitCode === null) {
|
||||
@@ -56,8 +59,8 @@ export function shouldRecordProcessGoneCrash({
|
||||
exitCode: number | null
|
||||
expectedTeardown: ExpectedTeardownScope
|
||||
}): boolean {
|
||||
// Why: GPU and Network Service exits are recoverable Chromium child-process
|
||||
// churn; treating them as app crashes creates noisy user prompts.
|
||||
// Why: GPU, Network Service, and Audio Service exits are recoverable Chromium
|
||||
// child-process churn; treating them as app crashes creates noisy user prompts.
|
||||
if (isRecoverableChromiumChildProcess({ source, processType, serviceName, reason })) {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user