fix: scheduler empty-resreq JOB_UPDATE crash (bug-1904); xcecli jobs list rejection text (bug-1906)

bug-1904: both scheduler JOB_UPDATE paths parsed "" as-is:
parse_resreq() returns success with a PRIMARY container whose body is
NULL, and apply_job_task_count() wrote through it. Use ingest's default
("type == any") instead.

bug-1906: xcecli jobs list sent local selection-parse errors through
ExtractErrorMessage, which strips brackets and the quoted selection;
report them as written.

Also logs bug-1905 (xcecd_virtual ignores kill of a running job). All
three found by job-array-one-based-index task 10.2's live REST flow.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-01 14:34:17 +00:00
parent 6439e5852f
commit 6e631caa22
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
9 changed files with 392 additions and 12 deletions

57
.wolf/bugs/bug-1906.md Normal file
View file

@ -0,0 +1,57 @@
---
id: "bug-1906"
status: "open"
status_updated: "2026-10-01"
status_note: "newly logged"
component: "xcecli"
severity: "wrong-result"
timestamp: "2026-10-01T14:32:21Z"
last_seen: "2026-10-01T14:32:21Z"
occurrences: 1
files: ["src/frontend/xcecli/cmd/jobs/list.go"]
tags: ["job-array", "error-message", "selection"]
related: []
---
# bug-1906: xcecli jobs list drops the selection and its brackets from rejection messages
## Description
**Observed:**
```
$ xcecli jobs list '1-0-1790863351-0[1,3]'
failed to get parameter: [expected <job-id>, <array-id>k or <array-id>a-b]
$ xcecli jobs kill '1-0-1790863351-0[1,3]'
invalid job identity or element selection '1-0-1790863351-0[1,3]': expected <job-id>, <array-id>[k] or <array-id>[a-b]
```
`jobs list` passed local selection-parse errors through `request.ExtractErrorMessage`, which strips every `[`/`]` and keeps only the text after the last `": "`.
**Expected:** the rejection names the selection as written and keeps the `[k]` syntax, as `jobs kill` does (job-array-one-based-index Requirement 5: a rejection names the rejected selection).
**Impact:** users of `jobs list` cannot tell which selection was rejected, and the hint shows `<array-id>k` instead of `<array-id>[k]`.
**Found by:** spec task (job-array-one-based-index task 10.2 live REST flow)
## Environment
- OS: no /etc/os-release; Docker container; NixOS kernel; kernel Linux 6.18.33 x86_64
- libc: none (xcecli is a statically linked Go binary, CGO_ENABLED=0; host glibc 2.42-47)
- Toolchain: gcc (GCC) 15.2.0, meson 1.9.1
- Build: asan (src/build.jai)
- Code: scheduler-framework @ 6439e585-dirty
- Deployment: none needed (client-side parse error); seen against a single-host 3-node HA deploy
## Reproduction
1. `xcecli jobs list 'garbage' </dev/null` (any rejected selection; no server needed).
- Frequency: deterministic (4/4 selections, 2026-10-01)
- Evidence: not kept (the new test guards it)
## Root cause
`cmd/jobs/list.go` (`RunJobsList`, `runArrayJobStats`) formatted `HandleJobFilter` errors with `request.ExtractErrorMessage`, a sanitizer meant for transport errors: it removes all brackets and keeps only the last `": "`-separated part, which drops the quoted selection.
## Fix
Both sites report the local parse error as written (`failed to get parameter: [%v]`, err), without `ExtractErrorMessage`.
## Verification
- Test: `TestRunJobsListReportsRejectedSelectionVerbatim` in `src/frontend/xcecli/cmd/jobs/list_test.go`; RED before the fix (6 assertion failures), GREEN after
- Suites: xcecli `go vet ./...` clean, `go test ./...` all ok (CGO_ENABLED=0); `/xce-build xcecli` asan rc=0
- Live: rebuilt xcecli against the deployment: `jobs list` rejections now read e.g. `invalid element selection '1-0-1790863351-0[40000]': element numbers must be at most 32767`
## References
- Related: none