Skip to main content

pid_to_session_map

Function pid_to_session_map 

Source
pub fn pid_to_session_map() -> HashMap<u32, String>
Expand description

Walk every initialized session and read its daemon.pid; return a map from pid → session_name. Used by wire status’s orphan-pid annotation (#173 follow-up) so a supervisor child’s pid — which no longer carries --session <name> in its cmdline post-#174 — is still correctly attributed to the session whose home it serves.

Cost: one filesystem read per session per status invocation. On a 133-session box that’s 133 small reads (a few ms total) — bounded

  • acceptable. The map is fresh per call; no caching, no staleness.