Skip to main content

Module host_hang_dump

Module host_hang_dump 

Source
Expand description

SPEC_HOST_UI_THREAD_HANG_WATCHDOG_2026_08_14 §1–2 — capture evidence of a wedged host UI thread before anything (a person, usually) kills it.

On 2026-08-14 the host’s UI thread stopped pumping for ~16 minutes with a window open; it was killed by hand and nothing had captured a stack, so the deadlock’s cause is still unknown. A deadlock raises no exception, so the crash handler path can’t see it — the dump has to be taken EXTERNALLY by another process (what procdump -h does), here the launcher, which already supervises the host and probes its UI thread (ui_liveness).

Detection + dump only. Automatically killing and respawning a wedged host (spec §1’s last step) is a separate decision and not done here.

Structs§

HangDumpLatch
One dump per hang episode. Feed it ui_liveness::consecutive_misses() after each probe tick; a reply resets the misses to 0, which re-arms it.

Constants§

HOST_HANG_DUMP_MISSES
Dump once the UI thread has missed this many consecutive liveness probes. The probe runs every 60 s (supervisor/windows.rs), so this is a UI thread silent for at least ~1–2 minutes. Two, not one: a laptop sleep can cost at most one miss (the first probe after resume is answered).
MAX_DUMPS_KEPT
Keep at most this many hang dumps; older ones are deleted.

Functions§

dump_dir
%LOCALAPPDATA%\CrashDumps\agentmux-host-hang\<instance_key> — kept apart from crash dumps (a hang dump and a crash dump mean different things to triage), and one folder per instance (instance_key = the launcher’s data-dir hash) so pruning never deletes another running instance’s evidence (ReAgent P2 on #3913).
dump_dir_under
dump_dir with an explicit base. None for a key that isn’t a single plain path component — it is joined onto a path.
dump_file_name
Sortable by name: zero-padded timestamp first.
prune_old_dumps
Delete all but the newest keep hang dumps in dir. Best-effort.