RunHealth

The process-health slot of a run, its run record, and the verdict of the runs before it.

Group libuptime

Declared in src/libs/libuptime/uptime/RunHealth.hpp.

Detailed description

diagnostic-reports §DGC-2 to §DGC-4. A crash handler cannot run for every failure: a fast fail on Windows, a kill and a power loss run nothing. So a run leaves a record on disk at start, and a clean-exit file at a controlled exit, and the next start reads what the run left.

Slots

A node app owns <baseDir>/process-health/ alone: a second live instance against the same base directory is refused (§VPP-7). A standalone app takes the first free slot <baseDir>/process-health/run-<k>/, so two Construct windows run side by side, each with its own slot. A slot is free when its heartbeat.lock is free. ProcessHealth keeps the lock for the whole run.

Files of a slot

File Written Meaning at the next start
run.json at start the run existed, and its log is this file
clean-exit by the before-exit hook the run ended cleanly
crash-marker by a crash handler the run crashed
crash.dmp, exit-code by the Windows crash sentinel the run crashed

History

A finished run's files move to <root>/history/<seq>-<start>-<pid>/, with a verdict.json. <seq> orders the runs, because a clock can move backwards between runs (diagnostic-reports §DGQ-5). The newest kHistoryRuns stay.

In this section