myxce/.wolf/bugs/bug-1549.md
Rongsong Shen d26ff8870d
feat(buglog): one Markdown record per bug, checked against a record standard
The buglog was one 27K-line JSON file whose fields covered only symptom,
root cause and fix, as free text: 2% of entries named the code version a
bug was found on, 12% the build profile, 36% a way to reproduce, and 58% of
the file was OpenWolf hook auto-detections ("Missing guard clause",
"Function not marked async" on .md files).

- .claude/skills/buglog/bug-record.md: the record standard. Eight
  sections (Summary as the title, Description, Environment, Reproduction;
  Root cause, Fix, Verification, References once fixed), each with the
  content it must contain -- e.g. Environment needs the OS, the libc the
  failing binary loads (from its ELF interpreter: glibc 2.42 in the nix
  shell vs 2.40 on the host), toolchain, build profile and commit.
- .wolf/bugs/<id>.md: 500 records migrated from buglog.json; every field
  verified to round-trip. They carry legacy: true and an explicit "not
  recorded" where the old log had no such field; component derived from
  file paths, severity from keywords (else unknown), fix_commits from
  hashes in status_note/fix that git resolves (91 of 463 fixed).
- .wolf/buglog-archive.json: the 710 hook auto-detections, verbatim.
- .wolf/buglog.json is now an index generated from the records, keeping
  the fields OpenWolf's hooks and `openwolf bug search` read.
- scripts/buglog.py rewritten: new (template + Environment collected from
  the machine and --binary), check, status (refuses a status the record
  doesn't support; fixed needs Root cause, Fix, Verification and
  --commit hashes git resolves), note, recur, set, show, list, triage,
  env, index. 29 unittest cases in scripts/tests/test_buglog.py.
- scripts/git-hooks/pre-commit runs `check --staged`: incomplete staged
  records, a legacy record hand-changed to fixed without the fix-time
  sections, a new record claiming legacy: true, or a stale index refuse
  the commit.
- scripts/gitea-sync.py reads the records: issue body = the record's
  sections plus linked fix commits (origin remote, GITEA_COMMIT_REPO to
  override), and a body hash so an issue's text is refreshed when the
  record changes.
- bug-1866 rewritten to the full standard as the worked example.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 03:40:11 +00:00

4.9 KiB

id status status_updated status_note component severity timestamp last_seen occurrences files tags related legacy
bug-1549 fixed 2026-09-24 apiserver unknown 2026-08-12T12:59:31Z 2026-09-19T09:00:00Z 2
src/controller/apiserver.c (apiserver_job_new_fun / apiserver_push_joblist hook)
src/frontend/apiserver/backend/clib.go (go_push_handler / handleDataset)
apiserver
controller
push-notification
job-submit
component-failover-adoption
task-5.1
live-e2e-finding
bug-1548
true

bug-1549: Jobs submitted via apiserver REST API (POST /xce/v1/jobs/create) never appear in apiserver's own…

Description

Jobs submitted via apiserver REST API (POST /xce/v1/jobs/create) never appear in apiserver's own job store (GET /xce/v1/jobs / GET /xce/v1/jobs/:id returns empty), even though the job is confirmed genuinely committed on the controller (verified directly via xce_test's joblist showing both jobs in PEND state). Reproduced for 2 jobs (one submitted at the moment of a primary kill, one submitted >1 minute after a clean new-primary failover) -- so this is NOT specific to the failover window, appears to be a general gap. By contrast, worker/host-list push (apiserver_push_workers/apiserver_push_workerlist, controller/apiserver.c) DOES work: GET /xce/v1/hosts correctly showed the live-joined worker with real data.

Environment

Not recorded (migrated from buglog.json).

Reproduction

Not recorded (migrated from buglog.json).

Root cause

NOT root-caused (out of task 5.1's boundary). apiserver_job_new_fun is wired as a HOOK_DETAIL_JOB_NEW hook meant to fire apiserver_push_joblist()/apiserver_push_jobarray() after a job commits (apply_committed_entry()); controller logs show zero evidence either way since apiserver.c has no INFO-level success logging on this path (only a WARN on push failure, push job list to api server %s has problem, rc %d, which also never appeared). Could be: the hook isn't actually registered/invoked in this build, or apiserver's join isn't registered in c->apiservers[] the push fan-out iterates, or something queue/resreq-specific. Discovered opportunistically while probing bug-1548; not independently isolated from bug-1548 (both could share a root cause -- c->apiservers[] fan-out list membership -- or be unrelated). REVIEW UPDATE (task 5.1 review, 2026-08-12): found the likely direct causal chain, narrowing this from 'could share a root cause or be unrelated' to 'very likely a downstream symptom of bug-1548'. src/controller/apiserver.c's on_apiserver_join() unconditionally calls xce_apiserver_push_jobs(c, ep) (bulk job resync) alongside xce_apiserver_push_workers(c, ep), but ONLY fires when a fresh join is actually processed by the controller. c->apiservers[] (the fan-out list push hooks iterate) is per-process, in-memory-only state -- no WAL/config replication (confirmed zero references outside apiserver.c) -- so a NEW primary starts with an empty registration table until each apiserver instance re-joins against it. If bug-1548 means apiserver's rejoin was never re-issued against the new primary, ctrl-2 never ran on_apiserver_join for it, so neither the bulk resync nor any incremental job push could ever reach apiserver -- cleanly explaining both job1 and job2 being empty. Recommend a fix attempt for bug-1548 be verified against this job-push symptom directly (if fixing the rejoin gap makes GET /xce/v1/jobs start populating correctly, that's confirmation bug-1549 was never an independent issue). TASK 5.2 RE-REPRODUCTION (2026-08-12T13:39:52Z): reproduced a third time in an isolated, apiserver-only (no worker/scheduler) idle-period E2E run -- a job submitted well after a clean failover (jobid 73930919093731328, controller-confirmed via the accepted response) still never appeared in GET /xce/v1/jobs. This occurred in the SAME run where bug-1548's rejoin gap was also independently reconfirmed with a clean negative control, strengthening (not just repeating) the downstream-symptom-of-bug-1548 hypothesis: if apiserver never re-joined the new primary at the application level, c->apiservers[] on ctrl-2 never gained an entry for it, so no push (bulk or incremental) could ever reach it -- independent of whether the underlying job-push wiring itself is otherwise correct.

Fix

FIXED as a downstream symptom of bug-1548 -- confirmed, not just hypothesized. Once apiserver's heartbeat-triggered rejoin (bug-1548's fix) correctly re-issues xcecli_join(HostRole_apiserver) against the new primary, the controller's on_apiserver_join() bulk job resync (xce_apiserver_push_jobs) fires as designed and populates apiserver's local job store. Live E2E re-validation (component-failover-adoption task 6.2): a diagnostic job submitted post-recovery correctly appeared via GET /xce/v1/jobs, with no client-triggered write request required during the outage window.

Verification

Not recorded (migrated from buglog.json).

References

  • Related: bug-1548