chore(buglog): bug-1899 fixed (40207402)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-01 12:29:28 +00:00
parent 4020740208
commit db16b565dd
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
2 changed files with 15 additions and 12 deletions

View file

@ -1,8 +1,8 @@
---
id: "bug-1899"
status: "open"
status: "fixed"
status_updated: "2026-10-01"
status_note: "newly logged"
status_note: ""
component: "apiserver"
severity: "wrong-result"
timestamp: "2026-10-01T05:10:35Z"
@ -11,6 +11,7 @@ occurrences: 1
files: ["src/frontend/apiserver/controllers/jobs.go"]
tags: ["apiserver", "control", "job-array", "code-review"]
related: ["bug-1898", "bug-1896"]
fix_commits: ["40207402"]
---
# bug-1899: ControlJobByID re-dispatches earlier selections on every later selection of one request
@ -45,15 +46,15 @@ for _, ujobFilterCdArray := range allFiltCdArrays { // one per selection
- Evidence: not kept (code reading only)
## Root cause
TODO: required for fixed/partial
In `ControlJobByID` (`src/frontend/apiserver/controllers/jobs.go`), `successJobs` was declared once outside the loop over the request's selections and appended to inside it, while the `backend.ControlJob` dispatch loop over the whole accumulated slice also sat inside the per-selection loop. Every later selection therefore re-dispatched all jobs collected for earlier selections, and the response was built from the accumulated slice.
## Fix
TODO: required for fixed/partial
Task 7.4 of spec job-array-one-based-index restructures the handler: all selections are validated before any store access; the selection loop only collects the jobs to act on (de-duplicated by `unique_job_id`) and the per-number not-found results; after the loop each job is validated once with `validateJobControl` and each accepted job is dispatched exactly once through `controlJob`.
## 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: `TestJobHandler_ControlTwoSelectionsDispatchOnce` in `src/frontend/apiserver/controllers/jobs_handler_test.go`: RED before (X[1],Y[2] dispatched [x1 x1 x1 x1 y2 y2]; A,B dispatched [A A A A B B]), GREEN after ([x1 y2], [A B])
- Suites: apiserver non-cgo unit tests (controllers, store, utils, backend) and the cgo build via `xce-build.sh apiserver asan build.jai`, all passing, 2026-10-01
- Live: n/a here; the live REST control flow is exercised in task 10.2 of the spec
## References
- Related: bug-1898 (same review), bug-1896 (spec job-array-one-based-index restructures this handler)