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
Start only selected matrix interpreters and repair crashed runners
A plain `run` started every interpreter instance of a matrixed env while
the run itself only executed the selected subset, so unselected children
could fail to start (or be repaired) for no reason. Separately, an ER
that died before publishing its port surfaced as a raw start error even
though a reinstall usually fixes it.
- Thread the run's env/interpreter selection into the payload-schema
fetch (`runOptions`, honoured only with `startRunners`). The CLI builds
one dict that feeds both the fetch and the run, so they cannot drift.
Selection is computed only for projects with a matrixed action and
selectors are never validated in the fetch, so a selector valid in a
sibling project cannot fail it.
- Repair a runner that crashed before its port (ServerExitedBeforePort
in the __cause__ chain) the same way as NO_VENV: install, then
restart. Only at the run gate and dispatch start, never during
metadata resolution, and never for timeouts, which are load problems.
- Rename repair_no_venv_env to repair_env and serialize repairs per
(project, env) so two callers never install into one venv at once.
- Pass the env's configured interpreter to the create_envs step in
install_env_for_project so a repair rebuilds the venv with the right
Python.
In a multi-project workspace, `run` fans out across every project that declares the action; spawned subprocesses are bounded by the machine-wide process budget (default: derived from the machine's CPU budget). Fan-out is throttled, never refused — workspace size does not limit which actions you can run. See [Process budget](guides/wm-server-internals.md#process-budget).
71
71
72
-
`--env` and `--interpreter` on `run` use the same selector semantics as `prepare-envs` (ADR-0050): they compose by intersection, and a matrix env's config-declared `default_interpreters` policy (see [Preparing Environments — default interpreter subset](guides/preparing-environments.md#default-interpreter-subset)) applies as the default when neither is given — so a plain `run` can execute only a local subset of a matrix (e.g. the newest interpreter) while CI still runs the full axis, mirroring `prepare-envs`.
72
+
`--env` and `--interpreter` on `run` use the same selector semantics as `prepare-envs` (ADR-0050): they compose by intersection, and a matrix env's config-declared `default_interpreters` policy (see [Preparing Environments — default interpreter subset](guides/preparing-environments.md#default-interpreter-subset)) applies as the default when neither is given — so a plain `run` can execute only a local subset of a matrix (e.g. the newest interpreter) while CI still runs the full axis, mirroring `prepare-envs`. The selection also decides which interpreter instances are *started*, not only which run: unselected matrix children are never started or repaired.
73
73
74
74
WAL environment variable and storage settings are shared with `start-wm-server` — see [`start-wm-server`](#start-wm-server) for details.
Copy file name to clipboardExpand all lines: docs/guides/preparing-environments.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -224,6 +224,15 @@ The ER signals the problem by returning error code `-32001` (`ENV_REINSTALL_NEED
224
224
225
225
The WM catches this, runs `CreateEnvsAction` + `InstallEnvsAction` for the affected env, then restarts the ER.
226
226
227
+
### Other triggers
228
+
229
+
The same install-then-restart repair also runs when a runner the run needs fails to start:
230
+
231
+
-`NO_VENV`: the venv is missing (or was just wiped as stale/relocated). Repaired wherever the failure surfaces — the run gate, the dispatch start, and metadata resolution.
232
+
- Crash before the port: the ER process exited before publishing its port (`ServerExitedBeforePort` in the failure's `__cause__` chain). Repaired only for an env the run needs — the run gate and the dispatch start — never during metadata resolution, and never for unselected matrix children, which the gate does not start.
233
+
234
+
Timeouts (the port wait expiring while the process is still alive) are load problems, not broken venvs, and are never repaired. Every repair runs at most once per start attempt: if the restart still fails, the error names the env and the project. Concurrent repairs of the same env are serialized so two callers never install into one venv at the same time.
235
+
227
236
### Runner routing
228
237
229
238
The runner that executes `CreateEnvsAction` / `InstallEnvsAction` during auto-repair depends on which env is being fixed:
0 commit comments