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
server: ListTasks lists every actor in each atespace it touches #520
To fill in actor status, listTasks calls substrate.ListActors for each atespace on the page. That call pages through every actor in the atespace, so a 50-task page costs as much as listing all actors there. Every page repeats it. This is the same scale concern as #510.
Substrate has no name filter or batch get, so the likely fix is concurrent per-task GetActor calls. That keeps the cost bounded by the page size.
Confirmed on current main (af62e9d). listTasks groups the page by atespace and calls substrate.ListActors once per group (internal/server/server.go:538-561). Client.ListActors loops over ListActors pages until next_page_token is empty (internal/substrate/client.go:702), so every page of tasks pays a full actor listing per atespace it touches.
Replaces the per-atespace listing with one GetActor per task, the same point read GetTask already uses, including treating NotFound as "actor removed outside AX". The read is factored into taskActor so both paths share the same semantics.
Runs the reads concurrently with a bound of 8 in flight. For an atespace with A actors and a page of N tasks, the old path read ceil(A / page_size) actor pages per atespace on the page; the new path reads exactly N actors, none of them twice.
A per-task read failure now affects only that task's status, instead of the whole atespace group.
Tests: TestServer_ListTasksReadsActorPerTask runs the real server against the in-memory Substrate fake. The atespace holds 53 actors while the page holds 3 tasks; the test asserts zero ListActors calls, exactly one GetActor per task, the actor's state for live actors, and the failed state for a task whose actor was removed. I added ListActorsCalls/GetActorCalls counters to the test fake for this. go test ./internal/server/... ./internal/substrate/... ./cmd/... passes, and go test -race ./internal/server/ passes.
Outside PRs are limited to collaborators in this repository, so could a collaborator open a pull request from yjjnls:fix-520?
@rakyll — happy to rebase, split, or step aside if you have plans for this.
Activity
yjjnls commentedon Nov 19, 2026
Confirmed on current
main(af62e9d).listTasksgroups the page by atespace and callssubstrate.ListActorsonce per group (internal/server/server.go:538-561).Client.ListActorsloops overListActorspages untilnext_page_tokenis empty (internal/substrate/client.go:702), so every page of tasks pays a full actor listing per atespace it touches.I have a fix on a fork branch: https://github.com/yjjnls/ax/tree/fix-520 (branch
fix-520inyjjnls/ax, one commitf83288b).What it does:
GetActorper task, the same point readGetTaskalready uses, including treatingNotFoundas "actor removed outside AX". The read is factored intotaskActorso both paths share the same semantics.Aactors and a page ofNtasks, the old path readceil(A / page_size)actor pages per atespace on the page; the new path reads exactlyNactors, none of them twice.Tests:
TestServer_ListTasksReadsActorPerTaskruns the real server against the in-memory Substrate fake. The atespace holds 53 actors while the page holds 3 tasks; the test asserts zeroListActorscalls, exactly oneGetActorper task, the actor's state for live actors, and the failed state for a task whose actor was removed. I addedListActorsCalls/GetActorCallscounters to the test fake for this.go test ./internal/server/... ./internal/substrate/... ./cmd/...passes, andgo test -race ./internal/server/passes.Outside PRs are limited to collaborators in this repository, so could a collaborator open a pull request from
yjjnls:fix-520?@rakyll — happy to rebase, split, or step aside if you have plans for this.