Repository navigation
A deployment answers its id on a probe route, and a probe listener echoes prepare's nonces - #529
Merged
Merged
Conversation
zlareb1
force-pushed
the
feat/cell-operator-commands
branch
from
November 11, 2026 13:25
29aca52 to
7cda6fb
Compare
zlareb1
force-pushed
the
feat/cell-probe-route
branch
from
November 11, 2026 13:28
a805c3d to
d8e6b86
Compare
zlareb1
force-pushed
the
feat/cell-operator-commands
branch
from
November 11, 2026 14:48
7cda6fb to
c9a4216
Compare
zlareb1
force-pushed
the
feat/cell-probe-route
branch
from
November 11, 2026 14:48
999d3d6 to
750ad9c
Compare
zlareb1
force-pushed
the
feat/cell-operator-commands
branch
from
November 11, 2026 15:11
c9a4216 to
3f1d204
Compare
zlareb1
force-pushed
the
feat/cell-probe-route
branch
from
November 11, 2026 15:11
750ad9c to
32b4e1c
Compare
zlareb1
force-pushed
the
feat/cell-operator-commands
branch
from
November 11, 2026 15:31
3f1d204 to
180449d
Compare
zlareb1
force-pushed
the
feat/cell-probe-route
branch
from
November 11, 2026 15:31
32b4e1c to
5098e96
Compare
zlareb1
force-pushed
the
feat/cell-operator-commands
branch
from
November 11, 2026 15:47
180449d to
2ea8282
Compare
zlareb1
force-pushed
the
feat/cell-probe-route
branch
from
November 11, 2026 15:47
5098e96 to
21aad8a
Compare
8 of 9 tasks
zlareb1
force-pushed
the
feat/cell-operator-commands
branch
from
November 12, 2026 02:22
2ea8282 to
28d2eef
Compare
…hoes prepare's nonces Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
…he bucket nonce has a test Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: zlareb1 <[email protected]>
zlareb1
force-pushed
the
feat/cell-probe-route
branch
from
November 12, 2026 02:48
4829f2c to
97d2fa9
Compare
zlareb1
marked this pull request as ready for review
November 12, 2026 02:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
Every deployment answers
GET /v1/health/deploymentwith the deployment id it verified at boot, andLOOM_CELL_PROBE_PORTstarts a probe listener that also answers the values underloom cell prepare's nonce keys in Postgres, ClickHouse and the document bucket, with the bucket and prefix it stores under.Why
The eleventh of the pull requests that implement cells. It stacks on #526. "Preparing a cell" has prepare prove it was given the live stores of the deployment it registers: it writes a nonce to each store and reads it back through the deployment's probe route, and attach checks the deployment id a cell's host reports. Neither the route nor the listener existed; prepare follows on top of this.
Design
server/health.py):GET /v1/health/deploymentanswers{"deployment_id": ...}from memory, the id the process verified at boot (''before). It reads no store, takes no credential, is not rate-limited, answers whatever the Host, and passes the cell gate as the other health paths do (server/transport/model_maintenance.py).server/core/cell_probe.py): withLOOM_CELL_PROBE_PORTset, every web process runs a second uvicorn server on that port, on a socket bound on every address (::with IPv4 too;0.0.0.0where IPv6 cannot open or bind; a port another program holds withoutSO_REUSEPORTfails at once; a process of the same user that sets it shares the port) withSO_REUSEPORT, so each process of the host accepts its share. It keeps the process's logging (nolog_config) and installs no signal handlers, both the main server's. Shutdown asks it to exit and waits, so uvicorn closes its own servers. Its ClickHouse read is taggedcell.probe. Only the web lifespan starts it (boot.start_probe_listener); the workers child, which shares the container's network, never binds it. A port it cannot bind is logged as an error and the process serves on without it. It answers the same path with the id andnonces: the Postgres rowloom.cell_probeand the KeeperMap key inloom._migration_lock, each namedcell-probe, and the bucket object<prefix>/_cell_probe(null without a bucket or a value). Each is read on the request from the process's own connections. A store that fails answers 503 naming it (store) and the error's type, and is logged with the error's text; past 60 answers a minute per process, 429 withRetry-After. It runs with or withoutLOOM_CELL, since prepare reads it on a deployment beforeLOOM_CELLrolls out; the process then verifies its id and reads no cell row.LOOM_CELL_PROBE_PORTneedsLOOM_STORAGE_AUTHORITY=postgresand authentication on, each refused at boot (with auth off the main port answers only its own hosts, so the route would not answer attach's host check).009_cell_probe.sqladdsloom.cell_probe (name, nonce, written_at), classified inPG_NO_MEMORY_CONTENT(prepare writes and deletes its row; no tenant data). The KeeperMap key and the object need no schema.Scope and risk
Off by default: with
LOOM_CELL_PROBE_PORTunset nothing listens and boot is unchanged. The main-port route reads memory only. The listener binds every address, notLOOM_BIND_HOST(the published address, which in a container differs from the one listened on); who may reach the port is the operator's network policy, as the page says.Compatibility, rollout and rollback
An additive Postgres migration (an N-1 build never reads the table) and an additive setting. Rollback: unset the port; the table may stay.
Tests
tests/unit/test_cell_probe.py: the main port answers the in-memory id with any Host and reads no store, and''before boot verifies one. The listener answers the id and each store's nonce; a store that fails answers 503 naming it and is logged with the store, the error's type and its text; past its rate it answers 429 withRetry-After, and again a minute on. A second process binds and listens on the port while the first listens (it fails withoutSO_REUSEPORT); a port it cannot bind is logged and no listener starts; a host whose IPv6 will not bind takes0.0.0.0.start_listenerbinds the configured port and serves on it; the listener serves on a real port, leaves the main server's SIGTERM and SIGINT handlers and the uvicorn loggers' levels in place, and stops when asked rather than by cancellation. The listener answers the bucket and prefix it stores under ('' and '' without a bucket). The bucket nonce is the object<prefix>/_cell_probe, read through the object-store fake, and reads None without the object or a bucket. Every test binds port 0. Not covered: the bucket read against a real object store, and the web lifespan starting and stopping the listener end to end.tests/unit/snapshots/settings_defaults.jsonpins the new setting's default.tests/unit/test_cell.py: a gated cell still answers/v1/health/deployment; the web lifespan step starts the listener only with the port set; the probe port without the Postgres authority or without auth is refused. Not covered: the workers child never starting a listener (it calls onlystart_cell_state, which starts none).tests/integration/test_cell_probe_stores.py: against a real Postgres and ClickHouse, a nonce under each reserved name reads back and none reads as null. Passed locally.tests/unit/test_cell_tenancy.py: the route census classes/v1/health/deploymentas a health probe.grep -rlE "rglob\(|walk_packages|BASELINE|snapshot|ratchet|census" tests/unitnames: 7101 passed), the probe, cell and tenancy tests,make lintandmake typecheck. The full unit suite has not run on this stack.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-check,make lint,make typecheckandmake test-unitpass: lint, typecheck and the targeted unit tests pass; the full unit suite has not run on this stack.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code