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
A gateway refuses a baseline lease with UNKNOWN_BASELINE for ~30 s after the worker joins #1300
Right after a worker joins a gateway, the gateway does not know the worker's baselines for about 30 s. simlock --gateway baseline list showed the worker's baseline only about 35 s after the worker restarted, and worker list showed "capacity unknown" until then. A --gateway lease --baseline <name> in that window would be refused at once with UNKNOWN_BASELINE ("no worker holds a baseline named …"), although the worker holds it.
What you expected
The gateway reads the worker's baselines as soon as the worker finishes starting. A baseline lease in the meantime waits for the worker instead of being refused.
How to reproduce
simlock --gateway daemon start, a worker with a saved baseline, joined to the gateway with a worker token, then restart the worker.
At once: simlock --gateway baseline list (baseline missing) and simlock --gateway lease --platform ios --baseline <name> --detach.
About 35 s later the list shows the baseline.
Environment
Simlock 0.5.0 package at main 14a3f826b, macOS 27.0.1 arm64, Xcode 27.1, Android emulator 37.2.13. Found in the 0.6 release E2E run on 2026-11-05. Gateway mode. A fresh gateway is affected most: one that has seen the worker before restores the last known baselines.
Logs and evidence
From a read of the code (the lease refusal was not run in the window, only the list delay was seen):
A worker that joins while still starting answers status.get with health and load only; the link stores that and reads no baselines (src/gateway/worker-link.ts:398-402). Baselines are read only for a running worker (#refreshRunning, worker-link.ts:418).
The join's full read parks on events.subscribe while the worker starts and times out after 10 s (WORKER_CALL_TIMEOUT_MS, worker-link.ts:46). After that only the 30 s tick (WORKER_VIEW_REFRESH_INTERVAL_MS, src/contract/worker-view.ts:24) reads the worker in full.
The router's assess (src/gateway/routing/serviceability.ts:55-75) finds holders only among views that list the baseline and does not count a starting worker as a possible holder, so the request is rejected, not queued (fleet-coordinator.ts:886-893).
No test covers a baseline lease right after a join.
Could not reproduce this in-process. Moving to bug:needs-info.
What I tried (fast e2e lane, fake driver, at 5069c243f). Each run: a gateway and a worker, the worker saves baseline checkout, both daemons stop, the gateway starts fresh, then the worker starts and joins while it is still starting. Right after that, --gateway lease --baseline checkout --detach is granted and --gateway baseline list shows checkout. That held in all three setups:
Worker startup held 3 s. events.subscribe waits for startup, then the full read gets the baselines.
The worker's first catalog.get after startup took 12 s. The gateway logged Worker view refresh failed: Timed out waiting for the worker's view refresh at +10 s. A worker event then started a new full read at +12 s, and that read got the baselines.
So the issue's line "after that only the 30 s tick reads the worker in full" is not right: a late subscribe answer starts a full read.
What the E2E host logs show (read-only, ~/.simlock-e2e on the E2E host):
The worker joined at 10:10:23.5 while it was still starting. Its startup ended 0.9 s later. The gateway logged no subscribe timeout, so the full read began at about 10:10:24.
The worker's log has no failed call from the gw: session. A failed read is logged at info, so none of them errored.
The two UNKNOWN_BASELINE refusals in the gateway log (10:11:15 and 10:11:20) were for the name nope. Those refusals are correct. No refusal of a baseline the worker held was logged.
Both logs were at info. At that level a timed-out view read (Worker view refresh failed, debug) and the read calls' durations are not written. So the logs cannot show why the first full read did not land.
The likeliest cause is that the first full read after startup took longer than 10 s, with no worker event before the next tick to start another read. That is not confirmed.
What would let me reproduce it:
Run it again with log.level: "debug" in both the gateway's and the worker's config.json. Then send:
the gateway's Worker view refresh failed lines and their message;
the worker's operation lines for the gw: principal in the 30 s after Daemon started, with durationMs for catalog.get, config.get, baseline.list and list.get.
The clock time of each --gateway baseline list and --gateway worker list run, so they can be placed against the worker's Daemon started line and the gateway's 30 s tick.
Activity
V3RON commentedon Nov 5, 2026
Written by an agent.
V3RON commentedon Nov 5, 2026
Could not reproduce this in-process. Moving to
bug:needs-info.What I tried (fast e2e lane, fake driver, at
5069c243f). Each run: a gateway and a worker, the worker saves baselinecheckout, both daemons stop, the gateway starts fresh, then the worker starts and joins while it is still starting. Right after that,--gateway lease --baseline checkout --detachis granted and--gateway baseline listshowscheckout. That held in all three setups:events.subscribewaits for startup, then the full read gets the baselines.Worker did not answer an event subscription in time. When the late answer came, it read the worker in full (worker-link.ts:283-293, Flaky e2e: gateway-fleet reads a worker's capacity before the worker has left starting #414).catalog.getafter startup took 12 s. The gateway loggedWorker view refresh failed: Timed out waiting for the worker's view refreshat +10 s. A worker event then started a new full read at +12 s, and that read got the baselines.So the issue's line "after that only the 30 s tick reads the worker in full" is not right: a late subscribe answer starts a full read.
What the E2E host logs show (read-only,
~/.simlock-e2eon the E2E host):gw:session. A failed read is logged atinfo, so none of them errored.UNKNOWN_BASELINErefusals in the gateway log (10:11:15 and 10:11:20) were for the namenope. Those refusals are correct. No refusal of a baseline the worker held was logged.info. At that level a timed-out view read (Worker view refresh failed,debug) and the read calls' durations are not written. So the logs cannot show why the first full read did not land.The likeliest cause is that the first full read after startup took longer than 10 s, with no worker event before the next tick to start another read. That is not confirmed.
What would let me reproduce it:
log.level: "debug"in both the gateway's and the worker'sconfig.json. Then send:Worker view refresh failedlines and theirmessage;operationlines for thegw:principal in the 30 s afterDaemon started, withdurationMsforcatalog.get,config.get,baseline.listandlist.get.daemon stop && daemon start, diddaemon statussayrunningafterwards? daemon start right after daemon stop leaves the worker stopped #1295 often leaves the worker stopped until a later command starts it.--gateway baseline listand--gateway worker listrun, so they can be placed against the worker'sDaemon startedline and the gateway's 30 s tick.Written by an agent.
github-actions commentedon Nov 20, 2026
Closing: no reply in two weeks. Comment with the missing information and it reopens for triage.