Flaky e2e: gateway-fleet reads a worker's capacity before the worker has left starting
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #421 by @V3RON — merged
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- distributed-systems, testing
Research direction
Start in e2e/gateway-fleet.test.ts at waitForWorkers and iosLimit, then read src/gateway/worker-link.ts (#rebuildView, #refreshStarting) and the changesCapacityOrLeases filter to see why daemon.started never triggers a refresh. Triage must settle the product question (refresh on leaving starting) before the test fix, and an open PR (#421) already claims the work; done means waitForWorkers waits for capacity/catalog presence and CI passes under the CPU-load conditions described.
Written by the indexing model from the issue text.
Description
What fails
e2e/gateway-fleet.test.ts > "gateway fleet > two workers join, status aggregates them, a kill disconnects one, drain flags the other" fails with AssertionError: expected 0 to be greater than 0 at expect(iosLimit(joined[0])).toBeGreaterThan(0). Seen once in CI on PR #409 (run 37477061691).
Cause: a race on main, not in a PR
The test waits only for both workers to be connected, then reads capacity from that first view. A worker that dials the gateway while its daemon is still starting answers status.get with health and host only (#398), so the gateway builds its view without capacity (worker-link.ts #rebuildView -> #refreshStarting). The view stays without capacity until the next refresh, and none is triggered when the worker becomes running: daemon.started is not a lease./device./install event (changesCapacityOrLeases), so the next read is a device or lease event or the 30s periodic tick. The test's iosLimit falls back to 0.
Evidence
- On
origin/main(37188b5), unmodified: 6 of 6 runs of the file pass under CPU load (16 busy loops on 12 cores), 5 of 5 unloaded. - On
origin/mainwithawait new Promise((r) => setTimeout(r, 1500))as the first line ofconvergeStartupinsrc/daemon/main.ts(a slower startup): 3 of 3 runs fail with this exact assertion (2 tests failed each time). - The window is the worker's startup time, so anything that lengthens startup (PR #409 adds a serial read, doctor pass and lease reconcile) makes it likelier. It is not specific to that PR.
Two things to decide in triage
- Product: should the gateway refresh a worker's view as soon as it leaves
starting? Today a freshly joined worker takes no routed work for up to 30s after its startup ends if no device or lease event happens first (checkFleetCoordinator/routing on a view with no catalog). - Test:
waitForWorkersin the file should wait forcapacity(and catalog) to be present before the test reads it.
- Dominant language
- TypeScript
- Stars
- 15
- Forks
- 1
- Avg merge
- 9h 6m
- Merged PRs (30d)
- 138
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstackincubator/simlock
-
bug:new
Difficulty 1/5 Under an hour Newbie friendliness 70/100
callstackincubator/simlock#430 ·
Maintainers usually reply within 1 day
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
callstackincubator/simlock#429 ·
Maintainers usually reply within 1 day
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
callstackincubator/simlock#424 ·
Maintainers usually reply within 1 day
-
daemon-lifecycle e2e: the it.fails status test passes for the wrong reasonPossibly taken @V3RON claimed this 1 day ago. Openbug:triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
callstackincubator/simlock#422 · 1 assignee ·
Maintainers usually reply within 1 day
-
bug:new
Difficulty 1/5 Under an hour Newbie friendliness 88/100
callstackincubator/simlock#420 ·
Maintainers usually reply within 1 day
All issues in callstackincubator/simlock
Similar issues
-
[Docs] README: FAQ setup command, IDA in the intro, Node badgePossibly taken @akram1089 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
morluto/rea#1353 · 1 comment ·
Maintainers usually reply within 1 day
-
[Feature]: [P3] engine-rs: the package source hash should ignore line endings and untracked filesOpen
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
maniator/verticopolis#880 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
siyuan-note/siyuan#20353 ·
Maintainers usually reply within 1 day
-
afk-ok area:data-quality importer size:S
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
enorm-labs/event-junkie#3027 ·
Maintainers usually reply within 1 day