--- id: "bug-1770" status: "fixed" status_updated: "2026-09-24" status_note: "" component: "scheduler" severity: "unknown" timestamp: "2026-09-04T00:00:00Z" last_seen: "2026-09-19T09:00:00Z" occurrences: 1 files: [] tags: ["scheduler", "resreq-parsing", "job-submission", "parjob-allocator", "pre-existing", "severity-high", "scheduler-allocation-discovery", "task-5.3"] related: ["bug-1766", "bug-1768", "bug-1769"] fix_commits: ["799a71ec", "5c87f1cc"] legacy: true --- # bug-1770: FIXED (2026-09-06, resreq-maxtasks-wiring feature, commits 799a71ec..5c87f1cc) ## Description FIXED (2026-09-06, resreq-maxtasks-wiring feature, commits 799a71ec..5c87f1cc). Originally: pre-existing, out-of-scope gap discovered during scheduler-allocation task 5.3's end-to-end integration test. The REAL job-ingest path could NEVER produce a primary resource request with maxTasks > 1, regardless of what task count a real job submission specified -- parjob_allocator.c's my_alloc() (maxTasks > 1) was therefore UNREACHABLE from any real production job submission. ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause CONFIRMED via direct code read and a genuine RED-phase run of test_parjob_e2e_multislot.c (src/scheduler/testsuite/): parse_resreq_primary() (src/lib/resreq.c:431-432) unconditionally hardcodes `primary->minTasks = 1; primary->maxTasks = 1;` after parsing a resreq string's select/rusage/span/same/affinity clauses, regardless of their content -- there is no resreq-string syntax for task count at all (LSF-style task count is a job-submission-level parameter, `job_submit_data_t.mintasks/maxtasks`, sibling to the resreq string, not nested inside it). Neither of this codebase's two job-ingest constructors -- core_build_job()/core_build_primary_schedobj() (src/scheduler/src/core_events.c, the real production JOBS_PUSH path) nor make_sched_job() (src/scheduler/src/schedobj.c, the sibling non-event construction path) -- ever copies the job's own submitted job_submit_data_t.mintasks/maxtasks (correctly propagated onto the TOP-LEVEL xce_sched_job_t.mintasks/maxtasks by both functions, confirmed working) onto the NESTED xce_primary_resreq_t.minTasks/maxTasks that sched_make_primary_alloc_()'s maxTasks>1 dispatch check (scheduler.c:290) and parjob_allocator.c's my_alloc() actually read. Net effect: every job's primary resreq that parses successfully has maxTasks pinned to 1, so sched_make_primary_alloc_() always routes it to seqjob_allocator instead of parjob_allocator (scheduler.c:290-294) -- parjob_allocator's real combinatorial multi-host allocation (scheduler-allocation spec, tasks 4.1-4.3) is fully implemented and unit-tested but cannot be exercised by any real job submission as the system stands today. Live-confirmed: test_parjob_e2e_multislot.c's own RED-phase run (maxTasks patch temporarily disabled) showed the job routing to seqjob and dispatching onto exactly 1 host instead of the intended 2 (`Expected 2 Was 1`). ## Fix FIXED (2026-09-06, resreq-maxtasks-wiring feature, commits 799a71ec..5c87f1cc, 12 tasks). Added apply_job_task_count(xce_resreq_t*, uint32_t mintasks, uint32_t maxtasks) (src/lib/resreq.c/resreq.h) -- overwrites a standalone top-level primary's minTasks/maxTasks with the job's real requested count (no-op for COMPOUND/ALTER nested primaries, deliberately left out of scope per bug-1768; defensive min>max clamp). Wired at both live ingest call sites: core_build_job() (core_events.c, fresh submission) using job->submit->mintasks/maxtasks, and the snapshot-restore path (snapshot_load.c, --sim/replay driver) using the job's already-restored mintasks/maxtasks -- both called strictly before their respective schedobj/resreq_fp builders read the task count. make_sched_job() (schedobj.c) intentionally NOT wired -- confirmed dead code (unreachable via sched_update(), which has zero live callers). Verified end-to-end via a new xce-test-multihost skill: a real multi-task job (and a multi-task array-job element) submitted via plain jobsub is genuinely split across two real xcecd_virtual hosts by the scheduler's own decision and reaches DONE on both. Full regression clean (scheduler/controller/worker suites, only pre-existing unrelated bug-1758/bug-1723 remain) and HA soak clean (sequential + chaotic, zero job loss/divergence). test_parjob_e2e_multislot.c's PATCH_MAXTASKS_FOR_BUG_1770 workaround is removed; that test now drives its scenario entirely through unmodified real ingest. Sibling gaps deliberately NOT fixed by this feature, tracked separately: bug-1772 (snapshot-restore resreq_fp gap), bug-1773 (resource-request update never taking effect for scheduling), bug-1774 (make_sched_job()'s dead-code resreq_fp gap). ## Verification _Not recorded (migrated from buglog.json)._ ## References - Related: bug-1766, bug-1768, bug-1769