myxce/src
Rongsong Shen 924ac32c1d
fix(scheduler): global limits on per-host resources now read the correct want (bug-1789)
sched_fill_limit_requests() used to read a limit's underlying resource's
want from the same vector its own virtual-resource entry gets written to.
That's wrong whenever the two differ in scope -- e.g. a GLOBAL limit built
on top of a per-host resource like "slots" (limits.yaml's
ug1_normal_slots): the limit's own vres entry belongs in alloc_req->shared,
but "slots"'s want is only ever staged into alloc_req->host by
seqjob/parjob_prepare_allocation(), so the old code always read a zero and
silently never enforced the cap.

Now both the read source and write destination are derived independently
from each resource's own XCE_RESF_GLOBAL flag (vres->res for the source,
vres->vres for the destination) -- the same flag
calc_wanted_global_resvals()/calc_wanted_host_resvals() (resreq.c) already
dispatch on, so this is the existing rule applied consistently rather than
a new one. Also drops sched_fill_limit_requests()'s unused xce_scheduler_t*
parameter.

Full scheduler suite: 76/77 (the one failure, test_job_rusage_reconciles_
mem_reservation_against_usage, is bug-1762, pre-existing and unrelated).
Live-verified against a fresh single-node deploy.

Filed bug-1790 to track a known, deliberately out-of-scope residual gap:
a future global limit on a per-host resource other than "slots" would need
calc_wanted_host_resvals() to also run during the global phase for that
resource, which nothing currently does.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GLfB5uWRdmx2WiZSFC7Fm7
2026-09-07 15:30:56 +00:00
..
autoscaler remove extralib 2026-09-04 11:24:43 +08:00
configs feat(worker-rejoin-resync): wire config fields into xceadmin build (task 1.5) 2026-09-01 09:47:02 +00:00
controller feat(eliminate-frontend-makefile): task 3.4 - update source code comments 2026-09-03 14:34:48 +00:00
docs feat(eliminate-frontend-makefile): task 3.3 - update live documentation (11 files) 2026-09-03 14:22:54 +00:00
frontend fix(apiserver): fix job control union discriminant, add human-readable job ID support (gitea#45) 2026-09-07 08:31:54 +00:00
include fix(scheduler): fix limit-plugin usergroup/scope/error-code cascade (gitea#46) 2026-09-07 12:44:16 +00:00
lib fix(scheduler): fix limit-plugin usergroup/scope/error-code cascade (gitea#46) 2026-09-07 12:44:16 +00:00
nixSupport remove extralib 2026-09-04 11:24:43 +08:00
scheduler fix(scheduler): global limits on per-host resources now read the correct want (bug-1789) 2026-09-07 15:30:56 +00:00
schema feat(worker-rejoin-resync): task 6.1 - trigger reconciliation on rejoin 2026-09-01 19:43:18 +00:00
tools feat(eliminate-frontend-makefile): task 3.2 - fix deploy-ha.sh/run.sh messages 2026-09-03 14:00:22 +00:00
worker fix(worker): real maxswap/maxtmp detection; feat(scheduler): annotate multi-slot assigned jobs 2026-09-07 04:39:22 +00:00
xceadmin build: make Go and Python builds fully offline (hermetic Nix build) 2026-09-03 12:38:49 +08:00
flake.lock remove extralib 2026-09-04 11:24:43 +08:00
flake.nix remove extralib 2026-09-04 11:24:43 +08:00
meson.build feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00
meson.options feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00