Skip to main content

repeats_crash

Function repeats_crash 

Source
pub(crate) fn repeats_crash(
    last: Option<(i32, Instant)>,
    code: i32,
    now: Instant,
) -> bool
Expand description

Whether this abnormal host exit repeats the previous one closely enough to be the same fault twice in a row — what the retry ladder answers with --disable-gpu (issue #3666).

A manual kill of a hung host also exits with code 1 (TerminateProcess, taskkill /F), so the code alone pairs two unrelated kills and the degraded relaunch sticks for the rest of the launcher’s life. Two things pair an exit instead:

  • a Windows fault code (an NTSTATUS exception, negative as i32): a real crash that repeats is deterministic however long the host ran between;
  • the same code as an exit within HOST_RESTART_WINDOW of the previous one: a crash soon after a relaunch, which is the case software rendering actually helps. A host that ran for minutes and was then killed is neither, so it degrades nothing.