You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sandbox2: the sandbox leader should own its namespace, not the creating process #1001
kind:featureA new feature or capability. Applied by the inbox-route classifier.priority:should-haveShould be done. Applied by the inbox-route classifier or a human.routed
Make a sandbox's leader process the owner of its namespace, and record that
leader's pid where the sandbox directory can be reclaimed against it. Today the
directory records the pid of whatever process created it, which is not the
process whose lifetime the sandbox actually tracks.
Why it matters
crates/sandbox2/src/config.rs names each sandbox directory {name}-{timestamp}-{attempt}-{pid} from std::process::id() — the creator.
Under the CLI that happens to work: mip creates the sandbox and lives
roughly as long as it, so when mip exits the pid dies and the directory is
reclaimable. mip cache clean relies on exactly this
(crates/mip/src/cmd_cache.rs, cleanup_stale).
Under the daemon it does not. minimald creates the sandbox and outlives
it, so the recorded pid stays alive for the daemon's whole life. Inside the
microVM minimald is pid 1, so every sandbox directory is stamped -1
and /proc/1 exists by definition — including across daemon restarts, where
the new daemon is pid 1 too.
Observed directly on a booted VM: every directory under the build base carried -1, e.g. build-1784239277-0-1.
Note on the deferral half, prompted by a question on #1002: ListSessions already carries a usable liveness and activity signal, and it is a better basis than the pid scan this issue replaces.
Liveness: ListSessionsEntry.attrs is Some only for sessions the manager has a running actor for (crates/minimald/src/sessions.rs, List arm). attrs.is_some() is therefore a true live-host check, orthogonal to the record's status — an Active record with attrs: None is a known-but-dormant session.
Activity: last_stdout / last_stdin, from HostAttrs.stdout_last/stdin_last. Real recorded timestamps, not a proxy like directory mtime. This is what min ls renders as LAST ACTIVITY.
Not available: session time alive. Neither HostAttrs nor sessions::Record records a start time; the only uptime in the system is the VM's (minvmd status --json → uptime_seconds, from State.started_at). Adding one would be a Record field.
Worth being explicit that session liveness is the wrong predicate on its own: a long-lived attached session is the steady state, so deferring on it would suppress maintenance permanently on exactly the hosts that need it — the same failure mode as the pid-1 defect, differently caused. Activity recency is the usable form.
The leader-pid work in this issue remains what answers "is a build in flight". The two signals are complementary rather than alternatives.
kind:featureA new feature or capability. Applied by the inbox-route classifier.priority:should-haveShould be done. Applied by the inbox-route classifier or a human.routed
Activity
norrietaylor commentedon Jul 28, 2026
Note on the deferral half, prompted by a question on #1002:
ListSessionsalready carries a usable liveness and activity signal, and it is a better basis than the pid scan this issue replaces.ListSessionsEntry.attrsisSomeonly for sessions the manager has a running actor for (crates/minimald/src/sessions.rs, List arm).attrs.is_some()is therefore a true live-host check, orthogonal to the record'sstatus— anActiverecord withattrs: Noneis a known-but-dormant session.last_stdout/last_stdin, fromHostAttrs.stdout_last/stdin_last. Real recorded timestamps, not a proxy like directory mtime. This is whatmin lsrenders as LAST ACTIVITY.HostAttrsnorsessions::Recordrecords a start time; the only uptime in the system is the VM's (minvmd status --json→uptime_seconds, fromState.started_at). Adding one would be aRecordfield.Worth being explicit that session liveness is the wrong predicate on its own: a long-lived attached session is the steady state, so deferring on it would suppress maintenance permanently on exactly the hosts that need it — the same failure mode as the pid-1 defect, differently caused. Activity recency is the usable form.
The leader-pid work in this issue remains what answers "is a build in flight". The two signals are complementary rather than alternatives.