The state machine describes and controls the state and health of Workers, Devices and Test Jobs.
For each worker, two variables describe the current status:
state
:health
:state
is an internal variable, set by lava-master
when receiving (or
not) pings from each worker.
Caution
When a worker is in STATE_OFFLINE, none of the attached devices will be used to schedule new jobs.
health
can be used by admins to control the health
of all attached
devices. For instance, when set to HEALTH_MAINTENANCE, all attached devices
will be automatically put into maintenance mode so that no jobs will be
scheduled on those devices.
For each device, two variables describe the current status:
state
:health
:state
is an internal variable, set by lava-master
and lava-logs
when scheduling, starting, canceling and ending test jobs.
health
can be used by admins to indicate if a device should be used by the
scheduler or not. Moreover, when ending an health-check, the device health will
be set according to the test job health.
For each test job, two variables are describing the current status:
state
:Note
Only multinode test jobs use STATE_SCHEDULING. When all
sub-jobs are in STATE_SCHEDULING, lava-master
will transition all test
jobs to SCHEDULED.
health
:The scheduler is called by lava-master
approximatively every 20 seconds.
The scheduler starts by scheduling health-checks. The remaining devices are
then considered for test jobs.
To ensure that health-checks are always scheduled when needed, they will be considered first by the scheduler before regular test jobs.
The scheduler will only consider devices where:
Note
A device whose health
is HEALTH_BAD, HEALTH_MAINTENANCE or
HEALTH_RETIRED is never considered by the scheduler when it is looking for
devices to run test jobs
The scheduler will only consider devices where:
state
is STATE_IDLEhealth
is HEALTH_GOOD or HEALTH_UNKNOWNstate
is STATE_ONLINE