Skip to main content

Module srv_spawner

Module srv_spawner 

Source

Structs§

SrvSpawnResult
What the launcher learns about srv after it signals ready. Held by the launcher and used to populate env vars the host reads.

Enums§

SrvSpawnError
Errors during srv spawn — granular enough that the launcher can log the right diagnostic.

Constants§

DATA_DIR_HELD_DIALOG_TITLE
Title for the fatal dialog both supervisors show on DataDirHeld.
MIGRATION_FAILED_DIALOG_TITLE
Title for the fatal dialog both supervisors show on MigrationFailed.

Functions§

closed_before_ready 🔒
Reap an srv that closed its ESTART channel before becoming ready, and say which refusal it was: a server already holding the data folder exits with DATA_DIR_HELD_EXIT, so the supervisor can show that plainly instead of a bare failed start.
data_dir_held_dialog_body
Body for that dialog: another server (a headless one, or another launch) holds this channel’s data folder, and this one cannot start beside it. Kept here so Windows and Unix say the same words.
failure_before_ready 🔒
The error for an srv that exited before ESTART: another server holding this data folder has its own code, so the supervisor can say that plainly; anything else is the generic closed channel.
forward_progress_line 🔒
One of srv’s progress lines (a data-preparation step or a migration, in the agentmux_common::srv_stderr protocol) as a splash sub-row of stage. false if line is not one. Shared by srv’s own startup (“backend”) and migrate --prepare (“prepare”).
migration_failed_dialog_body
Body for that dialog. Kept here (not in each supervisor) so Windows and Unix show the same words.
resolve_srv_binary 🔒
Resolve the agentmux-srv binary path from the LAUNCHER’s vantage point.
run_prepare 🔒
Run agentmux-srv migrate --prepare while srv is stopped, as the splash’s “Updating data” stage: copy the previous version’s data forward, back up, run the pending migrations, each a sub-row. The upgrade step of docs/specs/SPEC_FAST_STARTUP_UPGRADE_OWNS_MIGRATIONS_AND_UPDATES_2026_09_15.md §10, run by spawn_srv when srv reports AGENTMUXSRV-NEEDS-PREPARE.
show_spawn_failure
Show the person why an srv spawn failed, in plain words, for the failures the launcher can explain: a migration that could not run, or another server already holding this channel’s data folder. Other errors are the caller’s to log, as before. Kept here so Windows and Unix say the same words.
spawn_in_launcher_tree 🔒
Spawn cmd (an srv process: the daemon, or migrate --prepare) so it lives and dies with the launcher, before any of its code runs. Returns the child and its pid.
spawn_srv
Start srv and wait for it to be ready (spawn_srv_once). If srv finds data that needs preparing (a new version’s first start, pending migrations), it exits before writing anything; this then runs migrate --prepare on the splash and starts srv once more. A second “needs preparing” is a failure, never a loop.
spawn_srv_once 🔒
Spawn srv as a child of the launcher, assigned to launcher’s Job Object J0 so it dies cleanly with the launcher tree.