Scheduling system
The scheduling system turns queued jobs and reported cluster capacity into assignments, preemptions, and job state changes. It keeps durable scheduler state as the recovery record, builds a fast capacity view for each decision round, and publishes events at the boundary where executors and other services apply those decisions.
System role
The scheduler is the control-plane decision point between queued work and worker clusters. It matches job demand to eligible nodes within configured pools and preserves the state and event contracts needed by the scheduler ingester and executor services. The rules for ranking work and selecting nodes are covered in Scheduling algorithms and constraints.
Scheduling inputs
The scheduler combines demand, capacity, and policy. Demand comes from queued jobs and their placement needs. Capacity comes from executor reports that describe nodes, resources, current runs, and node availability. Queue, pool, priority, and rate settings shape each decision.
Queue fair-share weight can also come from a per-pool, per-queue priority override provider. A positive override replaces the queue's normal priority factor, so the provider must be ready before its values can affect scheduling. The setting is optional and is controlled by scheduler configuration.
The scheduler uses a small scheduling view instead of the full submitted job for most decisions. This view carries priority, pool eligibility, resource requests, placement rules, run history, and retry-related changes. Full job data remains available when the scheduler serves a lease to an executor.
Queued demand can be read from an incrementally maintained aggregate grouped by pool, queue, and priority class. The scheduler can compare this view with a per-job calculation while the aggregate is validated, or use it as the demand source when the feature is enabled. The scan remains authoritative during comparison.
Run failures and expired leases can also become new scheduling demand. When retry policy allows a retry, the scheduler may carry forward a changed resource request or node-avoidance rule only after it confirms that the changed job can still fit the cluster.
References: internal/…/scheduling_algo.go• L598-648 internal/…/scheduling_algo.go• L651-795 internal/…/queued_demand.go• L14-46 internal/…/aggregate.go• L10-19 internal/…/schedulerapp.go• L405-415 internal/…/configuration.go• L635-640 internal/…/types.go• L8-13 internal/…/schedulerobjects.proto• L83-140 internal/…/scheduler.go• L1309-1371
Scheduling outputs
Each scheduling round produces instructions for work that can start and work that must leave a node. A placement selects an executor, node, pool, and scheduling priority. A preemption records the removal of an existing allocation so that another job can use the capacity.
The scheduler treats a gang as one placement unit. A gang is a group of jobs that must be placed together. A failed attempt does not leave a partial placement. The scheduler also produces state changes when reconciliation finds a failed run, cancellation, expired assignment, completion, or retry outcome.
Each decision carries scheduling context. It identifies the selected node and method and records why other nodes were not usable. Preemption context identifies whether a removal came from fair-share or market-based selection, urgency placement, a gang sibling, or an unknown rescheduling cause. It can include the preempting job or jobs, bid values, or node and unschedulable details.
Each queue also has a round context that connects policy to results. It records the queue's weight, demand, fair share, allocation, and the resources and jobs that were scheduled, rescheduled, evicted, preempted by the optimiser, or left unscheduled. The context keeps these categories separate so reports can explain how the round changed queue state without becoming a separate command path.
References: internal/…/nodedb.go• L435-479 internal/…/pod.go• L34-60 internal/…/queue.go• L19-93 internal/…/queue.go• L229-385 internal/…/preemption_description.go• L21-65 internal/…/scheduling_algo.go• L985-1099 internal/…/scheduler.go• L775-798
Scheduling cycle
The scheduler repeats a bounded cycle at a configured cadence. It refreshes state, reconciles known runs, evaluates pools, and publishes the resulting event sequence. A hard time limit stops a cycle that runs too long. Softer limits can stop new-job work while allowing evicted jobs to be placed again.
The following diagram shows how queued demand and cluster reports become published decisions.
flowchart LR
E[Job and control-plane events] --> I[Scheduler ingester]
I --> D[(Durable scheduler state)]
D --> W[Scheduler working view]
X[Executor and node reports] --> W
Q[Queue and pool policy] --> W
W --> R[Scheduling and reconciliation]
R --> O[Lease, preemption, retry, and state events]
O --> P[Event stream]
P --> I
P --> K[Executors and downstream services]
State refresh
At startup, the scheduler rebuilds its active view from non-terminal jobs and their runs. During normal cycles, it refreshes rows changed after the last known positions. The refresh applies external state changes before it makes new assignments, then removes terminal work from the active view.
The working view is not the durable source of truth. PostgreSQL and ingested event positions support recovery after restart or leadership change. This separation lets normal cycles use fast local state without allowing an old local snapshot to drive a new leader.
When a run fails or an executor lease expires, reconciliation decides whether the job returns to the queue or reaches a terminal state. Queue retry policy can replace the normal attempt-limit decision, while gang jobs and unsupported policy cases use the established scheduling path.
References: internal/…/scheduler.go• L298-323 internal/…/scheduler.go• L479-562 internal/…/job_repository.go• L37-62 internal/…/job_repository.go• L80-177 internal/…/scheduler.go• L1309-1483 internal/…/scheduler.go• L1519-1631
Leadership boundary
Only the current leader may publish scheduling decisions. A non-leader can refresh its view, but it cannot assign capacity through the event boundary. A new leader first waits for durable state to catch up with the event stream, then resets in-flight work and performs a full refresh.
This boundary prevents two scheduler instances from assigning the same capacity. It makes leadership change a recovery point instead of a continuation of possibly stale work.
References: internal/…/scheduler.go• L220-237 internal/…/scheduler.go• L323-349 internal/…/scheduler.go• L433-441
Executor synchronization
The executor API is the live boundary between executor clusters and the scheduler. An executor reports its nodes, current run states, and unassigned runs. The scheduler stores that report for capacity decisions, then returns cancellations for inactive runs and leases for scheduled runs that the executor does not yet hold.
Before a lease reaches an executor, the API combines the selected node and pool with the job's run-level placement overlay. It also applies the retry resource change and filters resources that the cluster is not allowed to receive. This keeps the executor's workload request aligned with the scheduler's reservation.
Executors also send run outcome events through the same service boundary. The API authorizes those calls and publishes the event sequences to the event stream so the ingester can update durable state for later scheduling cycles.
References: internal/…/api.go• L38-60 internal/…/api.go• L89-207 internal/…/api.go• L442-464 internal/…/api_test.go• L54-414 internal/…/api_test.go• L690-811
Pool decision process
The scheduler evaluates each configured pool as a capacity domain. It combines the pool's queued and active jobs with healthy nodes. It also accounts for work from related pools so that shared capacity is not assigned twice.
The capacity view narrows candidates by indexed node properties and then checks the full placement rules. Those rules include taints, labels, affinity, and available resources. The search favors the smallest sufficient capacity so a job does not consume a much larger node when a smaller fit exists.
The scheduler can try home placement, configured away placement, and preemption according to pool policy. Cross-pool work can use a lower accounting bucket so home work can displace it first. Evicted work has its own protected accounting so a new decision does not consume capacity needed to place it again.
Fair-share calculations distribute capacity by queue weight and priority level. They cap a queue's usable share by constrained demand, then redistribute unused share to queues that can use it. The round records both the demand-capped share used for current fairness and the uncapped share used to describe a queue's potential share.
An optional fairness optimiser examines work from queues below their fair share. It tests candidate gangs against groups of nodes that satisfy any gang uniformity rule. It can use controlled preemption when the fairness gain justifies the cost. Pool settings can also exclude jobs above a configured size from optimiser preemption. When gang preemption is enabled, it can keep some preempted gangs in place by moving incoming jobs to other eligible nodes. The result is accepted only when the whole incoming gang still meets the fairness threshold.
Market-priced pools also run a dry-run view that treats the pool capacity as one large placement space. This produces an idealised value and allocation for comparison with the value and allocation that physical node fragmentation allows. These values describe the round; they do not create leases.
Executors and nodes that are stale, cordoned, unschedulable, over-allocated, or too far behind on lease acknowledgements do not receive unrelated new work. When node pod limits are enabled, pod slots become a tracked resource and jobs without other resource requests still consume one slot.
Scheduling rounds also have global and per-queue rate limits. The queue scheduler can stop new work when a limit or time budget is reached and then drain evicted work. Configuration validation rejects combinations that would silently disable a pool feature.
References: internal/…/scheduling_algo.go• L428-550 internal/…/scheduling_algo.go• L885-1111 internal/…/scheduling.go• L247-401 internal/…/constraints.go• L18-80 internal/…/idealised_value.go• L20-107 internal/…/gang_scheduler.go• L53-105 internal/…/node_scheduler.go• L35-148 internal/…/optimising_queue_scheduler.go• L53-182 internal/…/queue_scheduler.go• L94-141 internal/…/nodedb.go• L555-646 internal/…/nodeiteration.go• L92-173 internal/…/nodematching.go• L124-203 internal/…/node.go• L18-29 internal/…/configuration.go• L544-565
Submit check
The submit check is a fast admission check that tests whether new work can fit in at least one configured pool. It uses a refreshed capacity view without changing durable allocations. Its result gives the submission path an early answer and a reason when no pool can accept the job.
The check groups gang members and treats the group as one unit. It can cache equivalent placement checks and applies global and per-queue time limits. Work that is not checked before a deadline remains unchecked for a later refresh.
For this feasibility check, cordoned nodes are treated as available. A cordon is temporary operational state, so it must not cause a job to be rejected when the node can accept work after it is uncordoned. With complete node-taint metadata, the check removes cordon taints and categorised non-user-facing taints while retaining user-facing, uncategorised, and control-plane taints. Older reports without complete metadata use the legacy cordon handling and remove only recognised cordon taints.
References: internal/…/submitcheck.go• L141-202 internal/…/submitcheck.go• L209-381 internal/…/node_factory.go• L138-191 internal/…/unschedulable.go• L13-38 internal/…/submitcheck_test.go• L102-117 internal/…/submitcheck_test.go• L414-447 internal/…/node_factory_test.go• L63-221
Scheduling observability
The scheduler keeps the latest scheduling context for each pool and exposes views for a whole round, a queue, or a job. These reports explain placement success and failure without changing the decision path.
Cycle metrics also describe the demand and capacity used by the decision. They cover queue demand and share, jobs and gangs considered, placements, preemptions, node capacity, node state, billing resources, market prices, and idealised versus realised scheduled value. Node capacity metrics group nodes by taint category: user-facing taints use user, administrator-defined taints use their sorted unique keys, and nodes without a recognised category use none. Metrics are published as a separate cycle record for each pool, while leader-only values are reset when leadership metrics are disabled.
Retry policy decisions and their final outcomes are also exposed so operators can distinguish a policy retry from a terminal failure or a legacy retry path. The metric view is separate from the event path and does not make a scheduling decision.
References: internal/…/repository.go• L18-93 internal/…/pod.go• L34-80 internal/…/queue.go• L29-80 internal/…/scheduling.go• L690-701 internal/…/cycle_metrics.go• L536-759 internal/…/cycle_metrics.go• L866-909 internal/…/node_category_metrics.go• L18-47 internal/…/constants.go• L6-31 internal/…/scheduler.go• L1374-1378 pkg/…/scheduler_reporting.proto• L19-69
Durable state
Durable scheduler state connects event ingestion, scheduling, and executor reads. It records the job and run data needed for a decision, executor observations needed for capacity checks, and event positions needed for catch-up and recovery. The scheduler ingester owns the conversion from event streams into this state. The scheduler consumes it to rebuild its working view. Details are covered in Scheduler state and ingestion.
Job and run state
The scheduler tracks jobs through queued, leased, running, retry, and terminal outcomes. It keeps links between jobs and runs so it can find active leases, group gang work, order queued jobs, and retain failure history across restarts. Transactions give one scheduling round a stable view and allow speculative changes to be committed only when the round succeeds.
Run history also supplies the input for retry limits. Genuine run failures count against retry budgets, while preempted and returned runs do not count as genuine failures. This keeps retry decisions stable after a scheduler restart because they come from durable run history rather than only from the current process state.
Within a queue, active work is considered before new queued work so evicted jobs can be tried again. The scheduler then applies urgency, queue priority, age, and a stable job identifier to produce a total order. Market-priced pools can use a job's pool bid after urgency when they build their queue order. These rules define which demand reaches the scheduling algorithms described in Scheduling algorithms and constraints.
JobDb also maintains an optional queued-demand view. It updates demand when queued jobs enter, change, or leave the working set and groups the result by pool, queue, and priority class. This view avoids repeated scans of all queued jobs when the aggregate feature is enabled. In comparison mode, invariant counters and mismatch metrics expose drift instead of changing the scan-derived result.
Job scheduling information includes placement requirements such as node selectors, required node affinity, tolerations, resource requests, and Armada priority class. A scheduling key groups equivalent placement requirements so the scheduler can recognize work that has the same placement shape. It does not include annotations, resource limits, zero-valued requests, or toleration duration in that key.
References: internal/…/jobdb.go• L68-109 internal/…/jobdb.go• L365-408 internal/…/jobdb.go• L487-509 internal/…/comparison.go• L36-172 internal/…/aggregate.go• L38-140 internal/…/queued_demand.go• L14-28 internal/…/scheduling_algo.go• L609-648 internal/…/podutils.go• L13-68 internal/…/job.go• L865-897
Capacity state
Executor and node records describe where the scheduler may place work. An executor belongs to a pool and reports its nodes and heartbeat time. A node reports identity, labels, taints, resources, current runs, reservations, and whether operators marked it unschedulable.
The executor lease API turns each report into durable capacity input. It includes runs that are assigned to nodes and runs that are known by the executor but not yet assigned. The scheduler uses this record to avoid handing out stale work and to identify leases that must be cancelled.
The scheduler builds an internal capacity view for each pool round. The view separates total resources from resources available to Armada jobs. It also tracks allocations by job and available resources by priority so the scheduler can test placement, rescheduling, and preemption without changing the reported cluster state.
When node pod limits are enabled, configuration adds pods as a supported and indexed resource with one slot per job. This keeps node capacity, candidate lookup, and job accounting aligned. A configured resolution other than one is normalised before the capacity view is built.
Node taints now have two related forms in the scheduler contract. The raw Kubernetes taints support placement checks. Optional metadata identifies a taint category and whether it is user-facing. The scheduler uses complete metadata to distinguish temporary cordons from restrictions that must remain visible during feasibility checks and to group capacity metrics. Incomplete reports keep the older behavior rather than treating missing metadata as proof that a restriction is safe to remove.
The taint matching boundary returns a copy of the first taint that no supplied toleration accepts. This keeps placement checks independent from the stored node and node-type taint slices while preserving the Kubernetes toleration rules used by candidate matching.
Two special accounting levels support recovery and pool isolation. Evicted work is kept below normal priorities so the scheduler protects space for it. When cross-pool ordering is enabled, away work uses a separate lower level so home work can preempt it first. A node that is over-allocated stays visible when it has work that must be rescheduled, but it is not a target for unrelated new work.
These records form a capacity view rather than a command to the cluster. The scheduler selects a node. The executor and Kubernetes scheduler complete the actual workload start.
References: internal/…/schedulerobjects.proto• L9-81 internal/…/node.go• L31-149 internal/…/node.go• L152-220 internal/…/node.go• L271-323 internal/…/node.go• L459-605 internal/…/node.go• L645-741 internal/…/node_factory.go• L41-110 internal/…/node_factory.go• L138-191 internal/…/node_type.go• L37-42 internal/…/taint.go• L10-59 internal/…/nodematching.go• L206-219 internal/…/configuration.go• L652-681 internal/…/api.go• L89-127 internal/…/api.go• L466-500 internal/…/nodedb.go• L96-200
State ingestion
The scheduler ingester reads job-set and control-plane events from the event stream. It writes job, run, executor-setting, and position changes to PostgreSQL in order. The scheduler then requests changes after its last positions instead of rereading all state during every normal cycle.
Partition markers provide a durable catch-up check. A leader uses them to confirm that the ingester has reached the needed point in the event stream before it makes decisions from the state it reads.
References: internal/…/ingester.go• L24-85 internal/…/instructions.go• L67-148 internal/…/instructions.go• L433-442 internal/…/schedulerdb.go• L55-97
Publishing boundary
The scheduler does not start a pod directly. It publishes lease, preemption, cancellation, retry, and state events to the job-set event stream. Executors and other consumers apply those events. The ingester writes the resulting state back to durable storage.
Decision publication
A cycle gathers reconciliation events and scheduling results, then publishes them only while its leadership token is valid. The scheduler advances its read positions after successful publication. If publication fails, it leaves the positions behind so a later cycle can try the changed work again.
This boundary provides at-least-once publication rather than one transaction across the scheduler database and event stream. The working view can move forward for speed, but durable ingestion remains the confirmation path for the published change.
References: internal/…/scheduler.go• L384-476 internal/…/scheduler.go• L433-459 internal/…/publisher.go• L10-19 internal/…/pulsar_publisher.go• L73-119
Executor and downstream consumers
After a lease event reaches durable state, the executor-facing path reads the assigned run and the scheduling overlay needed to create the workload. The overlay can include the selected node and retry resource changes. The executor API adds the node selector, pool metadata, retry resource changes, and preemption marker before it sends the lease to the executor. The executor uses that information to start the job, while downstream consumers use the event stream to update their own views and history.
Executors report run outcomes through the API. The API publishes those event sequences to the same stream, which lets durable ingestion close or retry the run before a later scheduling cycle evaluates it.
Scheduling reports provide a separate read surface for operators and services. They expose recent pool, queue, and job context without becoming part of the command path.
References: internal/…/api.go• L141-196 internal/…/api.go• L229-290 internal/…/api.go• L315-409 internal/…/api.go• L442-451 internal/…/job_repository.go• L344-390 internal/…/scheduler.go• L1009-1053 internal/…/repository.go• L30-92
Contract boundaries
The scheduler depends on shared message shapes for jobs, placement requirements, executor reports, node capacity, taint metadata, and retry overlays. Generated scheduler and simulator messages also define the data used by scheduling simulations. Cluster pools and node templates describe capacity. Queues and job templates describe demand and timing.
The simulator runs the scheduling model against a simulated event clock and cluster workload. It uses the same scheduling configuration, job database, demand settings, and placement decisions, then emits state transitions for analysis. It keeps per-pool allocation and demand between simulated cycles so later decisions see the effects of earlier ones. Simulator event order is made deterministic before state transitions are emitted.
Changes to these message shapes or shared scheduling settings affect more than the scheduler. They can change durable ingestion, lease construction, executor behavior, reports, or simulation input and output.
References: internal/…/schedulerobjects.proto• L9-148 internal/…/schedulerobjects.pb.go• L64-177 internal/…/schedulerobjects.pb.go• L482-752 internal/…/simulator.go• L49-112 internal/…/simulator.go• L539-715
Change checklist
When these files or sections are changed, remember to consider these:
- Changes to indexed resources, their resolution, or tracked pod slots must preserve the link between capacity indexes, resource matching, and job accounting. The
podsresource must remain at resolution one when node pod limits are enabled. - Changes to node labels, taints, schedulability, or over-allocation must update both the candidate index and the full placement checks.
- Changes to node taint metadata or taint-copy and matching helpers must preserve raw taint matching, copy isolation, completeness detection, and the distinction between cordon, user-facing, and control-plane taints.
- Changes to node taint categories must preserve the metric category contract. Administrator-defined keys must remain sorted and unique, and user or unknown categories must not be reported as administrator categories.
- Changes to priority accounting must preserve the meaning and order of the evicted and cross-pool levels. Non-preemptible allocations must still reduce every real priority level.
- Changes to node iteration must preserve the lower-bound search and least-sufficient-capacity order. A coarse index must not turn an exact requirement failure into a placement.
- Changes to pool setup must preserve the distinction between home work, away work, and capacity held by other pools.
- Changes to gang scheduling or eviction must preserve all-member gang behavior and transaction rollback.
- Changes to scheduling limits must preserve the order in which new work and evicted work are considered. The hard cycle limit must still abort uncommitted work.
- Changes to submit checking must preserve gang-wide results, pool submission groups, cordon treatment, and partial-result behavior after a deadline.
- Changes to scheduling context or preemption descriptions must preserve the mapping from a decision to its operator-facing reason.
- Changes to executor lease or report messages must preserve the link between stored executor state, inactive-run cancellation, lease overlays, and event publication.
- Changes to retry policy evaluation, failure counting, or retry mutations must preserve the boundary between a policy retry, a legacy retry, and a terminal failure. A changed resource or node rule must be checked before the job is requeued.
- Changes to retry resource mutations must preserve the same reservation seen by the scheduler and the resource request sent to the executor.
- Changes to allowed resources or node identity labels must preserve the executor-to-cluster contract. Unsupported resources must not reach Kubernetes, and retry node avoidance must still match the reported node label.
- Changes to queued-demand aggregate updates must keep add, replace, and delete paths in sync with the queued job indexes. Compare mode must keep the scan-derived demand authoritative until mismatch metrics stay at zero.
- Changes to aggregate feature flags must be applied when the JobDb is created in both the scheduler and simulator. Enabling reads without maintaining updates produces incomplete demand.
- Changes to optimiser cadence, fairness thresholds, preemption ordering, or maximum evictable job size must preserve pool isolation, cross-pool priority, and the rule that only eligible jobs can be evicted.
- Changes to scheduler object or simulator message fields must be reviewed with all producers and consumers of the generated contract.
- Changes to publication or position markers must preserve leadership validation, successful-publish position updates, and durable ingester catch-up.
- Changes to priority override readiness or values must preserve the per-pool, per-queue fair-share contract.
- Changes to queue scheduling context must preserve the difference between allocated resources, newly scheduled resources, rescheduled resources, evicted resources, and optimiser preemptions.
- Changes to job ordering must preserve the precedence of active work, urgency, queue priority, age, bid price where applicable, and stable job identity.
- Changes to idealised or realised market values must preserve the distinction between a dry-run comparison and actual placements. Idealised scheduling must not publish leases or alter durable allocations.
- Changes to cycle metrics must preserve the separation between leader-only local metrics and published per-pool cycle records. New node category labels must use the same taint metadata in both local and published capacity views.
- Changes to simulator event handling must preserve simulated time, deterministic decision order, allocation carry-over, and state-transition emission.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A node label, taint, or schedulability change is not reflected in its indexed type | The scheduler can skip a valid node or consider a node that does not meet placement rules | Node updates rebuild derived type data and the final match checks the full node |
| Taint metadata is incomplete but the submit check treats missing metadata as safe to remove | A real placement restriction can be hidden during admission | Completeness is checked by matching raw taint identities, and incomplete reports use legacy handling |
| Taint metadata is classified with unstable or non-unique administrator keys | Capacity metrics split one node class into several labels or show different classes for the same taints | Node categories sort and deduplicate administrator taint keys, and give administrator categories precedence over user categories |
| A taint match returns or mutates a stored taint object | Later placement checks can see changed node or node-type restrictions | Taint helpers deep-copy returned and stored taints before they cross the matching boundary |
| Pod-limit tracking uses a scale other than one slot per job | Jobs can consume the wrong number of pod slots | Enabling node pod limits normalizes the pods resource to resolution one before node state is built |
| Queued-job changes do not update the demand aggregate | Aggregate-based rounds can understate or overstate queue demand | JobDb updates the aggregate with job replacements and deletes; compare mode reports drift |
| Away work is not placed in the cross-pool accounting level | Home work can preempt home work before away work | Pool-aware node accounting assigns away allocations to CrossPoolPriority |
| Evicted work is released from ownership instead of moved to its protected accounting level | Resources can be released or counted twice | Eviction keeps ownership and the original scheduled priority until removal |
| A gang attempt commits after only some members fit | A gang can remain partially placed even though it is not runnable | Gang placement uses one transaction and aborts a failed attempt |
| A stale, cordoned, unschedulable, over-allocated, or lagging executor is used as a target | New work can be sent to capacity that cannot accept or acknowledge it | Executor and node filters remove unsafe targets before placement |
| Submit check time limits are treated as a complete answer | Unchecked jobs can be reported as unschedulable instead of being checked later | The checker returns partial results and retains unchecked work for a later check |
| A retry policy grants a retry but its resource or node-avoidance change is not schedulable | The job can be requeued forever without a valid placement | The scheduler checks each retry mutation and makes the job terminal when the changed request cannot fit |
| Run history counts preempted or returned runs as genuine failures | Retry policy budgets can be consumed by events that should not count as job failures | Failure counts exclude runs marked as ever preempted or returned |
| Publication fails after a cycle reads state | A later cycle can repeat the same decision | Read positions advance only after successful publication |
| A scheduler becomes leader before the ingester catches up | Decisions can use incomplete durable state | Partition markers and leadership activation enforce the catch-up boundary |
| A retry overlay is applied without the matching resource mutation | The executor can run with a request that differs from the scheduler's reserved capacity | Lease construction applies the overlay and retry mutation before it sends the workload |
| The optimiser can preempt a job above its configured size limit | A fairness action can remove work that the pool policy intends to protect | The node scheduler rejects jobs larger than MaximumJobSizeToPreempt as preemption candidates |
| Idealised market value is mistaken for a placement result | Reports can claim capacity or value that no node layout can provide | Idealised scheduling uses a separate dry-run context and only stores comparison values |
| A cycle metric is read after its leader-only state is reset or published with the wrong pool context | Operators can see stale, missing, or misattributed scheduling data | Per-cycle metrics are replaced atomically and published from each pool's scheduling context |
| Simulator allocation is not carried into the next cycle or event order is unstable | Simulation results can diverge between runs or differ from live scheduling assumptions | The simulator stores per-pool allocation and sorts scheduled and preempted jobs before emitting events |
Key files
| File | Why to read it |
|---|---|
| internal/…/scheduler.go | Shows the scheduler cycle, leadership checks, state refresh, reconciliation, retry decisions, event creation, and publish boundary |
| internal/…/api.go | Shows how executor reports become capacity state, how leases cross to executors, and how executor events enter the event stream |
| internal/…/configuration.go | Defines scheduling limits and pool policy, including tracked pod capacity and optimiser controls |
| internal/…/scheduling_algo.go | Shows how a pool round combines queued jobs, active jobs, executor health, node capacity, reconciliation, and scheduling results |
| internal/…/scheduling.go | Shows how a pool round records capacity, demand, fair share, allocations, and preemption outcomes |
| internal/…/queue.go | Shows the queue-level record of scheduled, rescheduled, evicted, and optimiser-preempted work |
| internal/…/idealised_value.go | Shows the dry-run comparison used for market-priced pool value and allocation |
| internal/…/node_scheduler.go | Shows the boundary for node fit, eligible preemption, gang handling, and fairness impact |
| internal/…/nodedb.go | Shows the capacity view, node matching, priority accounting, gang placement, and preemption choices |
| internal/…/node.go | Defines the scheduler's node capacity, taint metadata, and allocation view |
| internal/…/node_factory.go | Defines node construction and the cordon handling used by submit feasibility checks |
| internal/…/node_type.go | Exposes shared node-type taint copies and toleration matching for candidate checks |
| internal/…/unschedulable.go | Defines the distinction between temporary cordon taints and control-plane taints |
| internal/…/taint.go | Defines safe taint copies and Kubernetes toleration matching used by node and node-type checks |
| internal/…/submitcheck.go | Shows the early fit check used by job submission |
| internal/…/job.go | Defines the scheduler's job and run state, including durable failure history used for retry decisions |
| internal/…/comparison.go | Defines the stable order in which queued, active, and market-priced jobs reach scheduling |
| internal/…/cycle_metrics.go | Shows local and published measures for scheduling demand, capacity, outcomes, and market value |
| internal/…/node_category_metrics.go | Defines the node capacity categories derived from taint metadata |
| internal/…/metrics.go | Shows the periodic queue and cluster metric view built from scheduler and executor state |
| internal/…/schedulerobjects.proto | Defines the shared executor, node, taint metadata, job requirement, and retry contracts |
| internal/…/ingester.go | Shows the event-to-durable-state role that feeds scheduler decisions |
| internal/…/instructions.go | Shows how event data becomes ordered scheduler database operations and position markers |
| internal/…/publisher.go | Defines the event publication and partition-marker boundary |
| internal/…/simulator.go | Shows how the scheduling model runs against simulated workload, time, capacity, allocation, and state transitions |
| Scheduling algorithms and constraints | Explains the policy rules that rank work, select nodes, and preempt jobs |
| Scheduler state and ingestion | Explains durable state, event ingestion, ordering, and recovery |