docs(buglog): bug-1907 fixed in 47551fb2

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-02 02:14:02 +00:00
parent 47551fb21d
commit 621b77a688
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
2 changed files with 21 additions and 18 deletions

View file

@ -1,8 +1,8 @@
---
id: "bug-1907"
status: "open"
status_updated: "2026-10-01"
status_note: "newly logged"
status: "fixed"
status_updated: "2026-10-02"
status_note: ""
component: "controller"
severity: "wrong-result"
timestamp: "2026-10-01T15:49:05Z"
@ -11,6 +11,7 @@ occurrences: 1
files: ["src/controller/src/job.c", "src/harness/test.c"]
tags: ["harness", "job-control", "not-found", "job-array"]
related: ["bug-1896"]
fix_commits: ["47551fb2"]
---
# bug-1907: harness setpend and jobrun cannot report not-found: the controller acks status 0 first
@ -38,21 +39,21 @@ So harness `jobrun -j <id>` and `setpend -j <id>` succeed for a job (or array el
## Reproduction
1. Start a controller (xce-deploy-ha) and run `xce_test` against it.
2. `jobrun -j 0-0-1-5` (an ID that was never submitted) and `setpend` with `-j 0-0-1-5`: both report success (expected from the code; not run).
3. Compare `jobkill -j 0-0-1-5`, which reports not found.
- Frequency: deterministic (by code; not run live, 2026-10-01)
- Evidence: not kept (code references above)
2. `jobrun -j 0-0-1-5` (an ID that was never submitted) and `setpend` with `-j 0-0-1-5`: both report success .
3. Compare `jobkill -j 0-0-1-5`, which reports not found. (`jobrun` is a client-context command; `setpend` is in the scheduler context.)
- Frequency: deterministic (1/1 live, 2026-10-01)
- Evidence: /home/claude/tmp/bug-1907-red.out
## Root cause
TODO: required for fixed/partial
`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
TODO: required for fixed/partial
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 "<cmd>: job <arg> not found" (plus the `<array-id>[k]` hint for a bare identity).
## Verification
- Test: TODO: name + file; RED before the fix, GREEN after
- Suites: TODO: suite results and build profile
- Live: TODO: soak/deploy run, or n/a and why
- 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-5` printed nothing and `setpend -j 0-0-1-5 -p 1` printed `ok`, script exit 0 (/home/claude/tmp/bug-1907-red.out). GREEN after: both print `job 0-0-1-5 not found` + hint and exit 1; `jobrun -j $jobid[3]` on a missing element reports it not found; `setpend`/`jobrun` on the real `$jobid` still 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