Job queue architecture
The service manages job lifecycle through two background processes:
One periodically retrieves
current_datafrom running jobs. This is service data that allows more flexible job management — the job can use it to track progress, store intermediate results, and coordinate with the service updating those data in job context.The other manages the queue: starts pending jobs and checks completion status.
Regardless of how many service instances are running, only one instance controls queue management.
Job queue view is avaiable via get job queue request.
Jobs are processed in FIFO (first-in, first-out) order. Each Kubernetes namespace
has its own job pool with an independent queue. The number of simultaneously running
jobs per namespace is limited by parralel_job_limit (configured for the default namespace
and for each namespace in allowed_namespaces):
# settings for default namespace
[LAMBDA_RESOURCE_LIMITS.DEFAULT_NAMESPACE]
# parralel job limit for default namespace
parralel_job_limit = 20
# other limits for namespace
...
# settings for other allowed namespaces
[LAMBDA_RESOURCE_LIMITS.allowed_namespaces.0]
# example of allowed namespace name
namespace = allowed-namespace
# parralel job limit for non-default namespace
parralel_job_limit = 20
# other limits for namespace
...
Job statuses
Job status — main lifecycle states:
Status |
Description |
|---|---|
|
Job is waiting to be started from the queue |
|
Job is running in Kubernetes |
|
Job has completed successfully |
|
Job has finished with an error |
Job queue status — last execution status in the queue:
Status |
Description |
|---|---|
|
Job has never been executed yet |
|
Job has partially completed and will be started again (remaining work) |
|
Job has fully completed all work |
|
Job cannot start due to insufficient resources in the namespace
(CPU, RAM, GPU, labels)
|
|
An error occurred during job execution |
Job lifecycle in the queue
A job is created with status
pendingand enters the queue.The service finds it in the queue and attempts to start:
If the pod is not yet running — starts it.
Checks namespace resources (CPU, RAM, GPU, labels) — if insufficient, requeues with
insufficient_resources(see LAMBDA_RESOURCE_LIMITS for details).
After starting, the status changes to
running:The
completenessendpoint is checked periodically — if the job reports that it has finished all work, the job is done → statusdone.The
max_operating_timeis checked — if exceeded, the job is stopped and requeued withrunning_partial.The
execution_completenessandbusyendpoints are checked — if the job reports partial completion and is not busy, it is requeued withrunning_partial.
On errors — requeued with
failed.
Queue management via HTTP API
When creating or updating a job/workflow via the API, the deploy_parameters
includes the allow_insufficient_resources parameter (default 0 / false):
``allow_insufficient_resources = 0`` (default) — if the namespace does not have sufficient resources (CPU, RAM, GPU, labels), the job will not be created or will be rejected. The service returns an error.
``allow_insufficient_resources = 1`` — the job will be created and added to the queue even if resources are insufficient. The job will wait in the queue (
insufficient_resources) until resources become available, then start.
Configuration parameters
Parameter |
Description |
|---|---|
|
Interval for updating |
|
Maximum job operating time in seconds. After expiration, the job
is stopped and requeued with
running_partial. |
|
Periodic check and disable of inactive jobs.
Contains:
interval, interval_type,check_interval, active. |