cockpit.list_services times out: serialized N+1 RPC fan-out to hero_proc #5

Open
opened 2026-05-23 04:11:50 +00:00 by mik-tf · 0 comments
Owner

Found while running a verification pass against a local cockpit install. The cockpit.list_services handler at crates/hero_cockpit_server/src/main.rs:460 calls service.list_full, then for each returned service it awaits a serialized service_status followed by a serialized service_stats. With around 90 services registered in hero_proc on a realistic VM, that is roughly 180 sequential RPC round-trips per page load, and the request reliably exceeds the router default 10 second upstream timeout. The visible symptom is that opening /services (which is the primary cockpit page after login) returns the plaintext string upstream timeout instead of the services table, which makes every cockpit lifecycle button unreachable. Likely fix is to fan the per-service service_status and service_stats calls out concurrently with futures::future::join_all (or to extend service.list_full to return state and stats inline, then drop the secondary calls entirely). Reproduced locally with 91 services discovered by hero_router. Happy to open a PR once a preferred shape is confirmed.

Found while running a verification pass against a local cockpit install. The `cockpit.list_services` handler at `crates/hero_cockpit_server/src/main.rs:460` calls `service.list_full`, then for each returned service it awaits a serialized `service_status` followed by a serialized `service_stats`. With around 90 services registered in hero_proc on a realistic VM, that is roughly 180 sequential RPC round-trips per page load, and the request reliably exceeds the router default 10 second upstream timeout. The visible symptom is that opening `/services` (which is the primary cockpit page after login) returns the plaintext string `upstream timeout` instead of the services table, which makes every cockpit lifecycle button unreachable. Likely fix is to fan the per-service `service_status` and `service_stats` calls out concurrently with `futures::future::join_all` (or to extend `service.list_full` to return state and stats inline, then drop the secondary calls entirely). Reproduced locally with 91 services discovered by hero_router. Happy to open a PR once a preferred shape is confirmed.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_cockpit#5
No description provided.