Skip to content

runtime/lava: add a liveness probe and fail fast on connect - #3208

Merged
nuclearcat merged 1 commit into
kernelci:mainfrom
nuclearcat:lava-liveness
Sep 9, 2026
Merged

runtime/lava: add a liveness probe and fail fast on connect#3208
nuclearcat merged 1 commit into
kernelci:mainfrom
nuclearcat:lava-liveness

Conversation

@nuclearcat

Copy link
Copy Markdown
Member

Every device and queue query the scheduler makes against a lab that has gone away blocks for the full 30s request timeout, once per job and per platform. There is no way to ask "is this lab up?" without paying that cost on an endpoint that also does real work.

Add LAVA.is_alive(), which polls /system/version/. lava-server answers it from a constant with no database access (SystemViewSet.version in lava_rest_app/v02/views.py) and the body is ~20 bytes, against ~16-78kB and a full device table scan for /devices/, so a caller can poll it regularly without adding any measurable load to the lab.

Any HTTP answer counts as reachable, including the refusals: labs that return 401 or 403 to an anonymous or unprivileged request are up, and treating them as down would stop scheduling against them entirely. Only a transport failure or a 5xx is reported as unreachable.

Also split the request timeout into a short connect timeout and the existing response timeout, so an unreachable host fails in seconds rather than after 30, and give Runtime a default is_alive() so callers can probe any runtime.

Every device and queue query the scheduler makes against a lab that has
gone away blocks for the full 30s request timeout, once per job and per
platform.  There is no way to ask "is this lab up?" without paying that
cost on an endpoint that also does real work.

Add LAVA.is_alive(), which polls /system/version/.  lava-server answers
it from a constant with no database access (SystemViewSet.version in
lava_rest_app/v02/views.py) and the body is ~20 bytes, against ~16-78kB
and a full device table scan for /devices/, so a caller can poll it
regularly without adding any measurable load to the lab.

Any HTTP answer counts as reachable, including the refusals: labs that
return 401 or 403 to an anonymous or unprivileged request are up, and
treating them as down would stop scheduling against them entirely.
Only a transport failure or a 5xx is reported as unreachable.

Also split the request timeout into a short connect timeout and the
existing response timeout, so an unreachable host fails in seconds
rather than after 30, and give Runtime a default is_alive() so callers
can probe any runtime.

Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
@nuclearcat
nuclearcat added this pull request to the merge queue Sep 9, 2026
Merged via the queue into kernelci:main with commit 4282c7f Sep 9, 2026
3 checks passed
@nuclearcat
nuclearcat deleted the lava-liveness branch September 9, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant