3.8 KiB
| id | status | status_updated | status_note | component | severity | timestamp | last_seen | occurrences | files | tags | related | fix_commits | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bug-1907 | fixed | 2026-10-02 | controller | wrong-result | 2026-10-01T15:49:05Z | 2026-10-01T15:49:05Z | 1 |
|
|
|
|
bug-1907: harness setpend and jobrun cannot report not-found: the controller acks status 0 first
Description
Observed: Found by code reading, no failing run captured. Both controller handlers reply before looking the job up:
src/controller/job.c:2246 handle_jobdispatch: init_reply_by_req(); reply.status = 0; xce_reply(...) /* then the work */
src/controller/job.c:3869 do_set_preason: init_reply_by_req(); reply.status = 0; xce_reply(...) /* then the work */
So harness jobrun -j <id> and setpend -j <id> succeed for a job (or array element) that does not exist.
Expected: like the other single-job commands, jobrun/setpend on an unknown job ID report "not found" (job-array-one-based-index Requirements 4.7 and 5.13).
Impact: wrong result: a test script that targets a wrong element (e.g. $jobid[0] on a new array) passes silently instead of failing.
Found by: review (job-array-one-based-index task 4.3 implementation notes and feature validation, 2026-10-01)
Environment
- OS: no /etc/os-release; Docker container; NixOS kernel; kernel Linux 6.18.33 x86_64
- libc: glibc 2.42-47 (interpreter /nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/ld-linux-x86-64.so.2)
- Toolchain: gcc (GCC) 15.2.0, meson 1.9.1
- Build: asan (src/build.jai)
- Code: scheduler-framework @ efff6b65-dirty
- Deployment: any (controller request handling)
Reproduction
- Start a controller (xce-deploy-ha) and run
xce_testagainst it. jobrun -j 0-0-1-5(an ID that was never submitted) andsetpend -j 0-0-1-5 -p 1: both report success (before47551fb2).- Compare
jobkill -j 0-0-1-5, which reports not found. (jobrunis a client-context command;setpendis in the scheduler context.)
- Frequency: deterministic (1/1 live, 2026-10-01)
- Evidence: /home/claude/tmp/bug-1907-red.out
Root cause
handle_jobdispatch (src/controller/job.c:2246) and do_set_preason (job.c:3869) send their reply with status 0 before touching the job; a missing job is only logged afterwards (set_preason PERROR, dispatch_a_job_). The early acknowledgement is deliberate: the scheduler sends these requests in batches and its publish/retry/redelivery logic (scheduler.c, test_scheduler_decision_publish_retry.c, test_scheduler_decision_redelivery.c) depends on it. The harness commands jobrun and setpend used the same requests and so reported success for any job ID.
Fix
Harness only; the controller/scheduler protocol is unchanged. New job_exists_or_report() in src/harness/test.c looks the job up with the same interruptible xcecli_jobinfo call jobinfo uses and judges the result with cmdutil_job_lookup_report(); cmd_jobrun and cmd_setpend call it before sending their request and return -ENOENT with ": job not found" (plus the <array-id>[k] hint for a bare identity).
Verification
- Test: live harness script against a 3-node controller deploy (no unit seam: the commands need a controller). RED before the fix:
jobrun -j 0-0-1-5printed nothing andsetpend -j 0-0-1-5 -p 1printedok, script exit 0 (/home/claude/tmp/bug-1907-red.out). GREEN after: both printjob 0-0-1-5 not found+ hint and exit 1;jobrun -j $jobid[3]on a missing element reports it not found;setpend/jobrunon the real$jobidstill succeed (exit 0) - Suites: harness meson suite 7/7 OK (asan, src/build.jai)
- Live: the GREEN run above (xce-deploy-ha, controllers only, 2026-10-01)
References
- Related: none