diff --git a/.wolf/buglog.json b/.wolf/buglog.json index 7ac238a6..9dbc3d52 100644 --- a/.wolf/buglog.json +++ b/.wolf/buglog.json @@ -16939,9 +16939,9 @@ }, { "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", @@ -16949,8 +16949,8 @@ "occurrences": 1, "error_message": "harness setpend and jobrun cannot report not-found: the controller acks status 0 first\n\n**Observed:**\nFound by code reading, no failing run captured. Both controller handlers reply before looking the job up:\n```\nsrc/controller/job.c:2246 handle_jobdispatch: init_reply_by_req(); reply.status = 0; xce_reply(...) /* then the work */\nsrc/controller/job.c:3869 do_set_preason: init_reply_by_req(); reply.status = 0; xce_reply(...) /* then the work */\n```\nSo harness `jobrun -j ` and `setpend -j ` succeed for a job (or array element) that does not exist.\n\n**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).\n**Impact:** wrong result: a test script that targets a wrong element (e.g. `$jobid[0]` on a new array) passes silently instead of failing.\n**Found by:** review (job-array-one-based-index task 4.3 implementation notes and feature validation, 2026-10-01)", "file": "src/controller/src/job.c, src/harness/test.c", - "root_cause": "TODO: required for fixed/partial", - "fix": "TODO: required for fixed/partial\n\nVerification:\n- Test: TODO: name + file; RED before the fix, GREEN after\n- Suites: TODO: suite results and build profile\n- Live: TODO: soak/deploy run, or n/a and why", + "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 `[k]` hint for a bare identity).\n\nVerification:\n- 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)\n- Suites: harness meson suite 7/7 OK (asan, src/build.jai)\n- Live: the GREEN run above (xce-deploy-ha, controllers only, 2026-10-01)", "tags": [ "harness", "job-control", @@ -16960,7 +16960,9 @@ "related_bugs": [ "bug-1896" ], - "fix_commits": [], + "fix_commits": [ + "47551fb2" + ], "record": ".wolf/bugs/bug-1907.md" } ] diff --git a/.wolf/bugs/bug-1907.md b/.wolf/bugs/bug-1907.md index 058db897..5a845b55 100644 --- a/.wolf/bugs/bug-1907.md +++ b/.wolf/bugs/bug-1907.md @@ -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 ` and `setpend -j ` 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 ": job not found" (plus the `[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