myxce/.wolf
Rongsong Shen 955efecd19
fix(controller): WAL_JOB_START loses pidinfo/start_time on restart replay (bug-1687)
Same class as bug-1678: apply_job_start_transition() sets the real
job->job.pidinfo (worker-reported PIDs/PGIDs/exdata) and start_time, but
the WAL fact for WAL_JOB_START only carried the shared wal_jobstate_t
{jobid, state} header -- both apply seams (apply_committed_entry() for
primary boot replay, apply_wal_entry() for standby catch-up) restored
state only. pidinfo stayed permanently NULL after a restart; start_time
was fabricated with time(NULL) at replay instead of being carried,
drifting from the true value.

Mirrors bug-1678's exact fix shape: capnp_encode_pidinfo()/decode_pidinfo()
(persist.c, using the pre-existing JobPIDInfo capnp struct -- no schema
change needed) serialize job_pidinfo_t into the WAL payload, trailing a
new uint64_t start_time field appended after wal_jobstate_t.
persist_submit_job_start_fact() replaces the old state-only
persist_submit_job_fact() call for this type. Both apply seams updated;
a payload of exactly sizeof(wal_jobstate_t) (any entry written before
this fix) decodes with pidinfo left NULL and start_time fabricated via
time(NULL), exactly matching pre-fix behavior -- full backward
compatibility, verified by every pre-existing WAL_JOB_START test using
the old bare-struct shape.

Also fixed a genuine, unrelated deadlock this change's larger payload
exposed in test_commit_barrier_reply.c: cbrp_count_jobstate_entries_ex()
matched WAL entries by exact payload size (==), so once WAL_JOB_START
legitimately grew it silently undercounted to 0 and a downstream test
spun forever polling an uncounted target. Fixed the match to >= (jobid/
state always live at a fixed leading offset) -- bisected via /proc/*/wchan
futex inspection (no ptrace in this sandbox), confirmed as the actual
cause, not the teardown-ordering red herring first suspected.

Found by an /xce-audit-invariants controller pass (field-complete apply
parity dimension, added after bug-1678). 6 new tests in
test_wal_job_start_fact.c; RED/GREEN independently verified (4 tests
genuinely failed pre-fix with exact expected-vs-fabricated value
mismatches, 2 backward-compat tests correctly passed both before and
after). Full controller suite: 1146 tests, 2 failures -- both the
pre-existing, unrelated bug-1561 overlayfs sandbox flake.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgYRU3zDTqNGV5Jk8aiKLg
2026-08-25 09:23:00 +00:00
..
hooks chore(wolf): sync anatomy/cerebrum/memory/hooks/token-ledger bookkeeping 2026-08-25 06:40:25 +00:00
_scan-state.json commit wolf status 2026-08-17 06:35:54 +00:00
anatomy-index.json commit wolf status 2026-08-17 06:35:54 +00:00
anatomy.md chore(wolf): sync anatomy/cerebrum/memory/hooks/token-ledger bookkeeping 2026-08-25 06:40:25 +00:00
buglog.json fix(controller): WAL_JOB_START loses pidinfo/start_time on restart replay (bug-1687) 2026-08-25 09:23:00 +00:00
cerebrum.md chore(wolf): sync anatomy/cerebrum/memory/hooks/token-ledger bookkeeping 2026-08-25 06:40:25 +00:00
config.json chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
cron-manifest.json chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
cron-state.json save wolf status 2026-08-18 14:50:44 +00:00
daemon.log save wolf status 2026-08-18 14:50:44 +00:00
designqc-report.json chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
identity.md chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
memory.md chore(wolf): sync anatomy/cerebrum/memory/hooks/token-ledger bookkeeping 2026-08-25 06:40:25 +00:00
OPENWOLF.md chore(wolf): guard buglog.json integrity, add dedupe rule and auto-checkpoint 2026-08-13 04:28:44 +00:00
reframe-frameworks.md chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
suggestions.json chore(wolf): checkpoint session state (anatomy, cerebrum, memory, scan-state) 2026-08-16 11:02:17 +00:00
token-ledger.json chore(wolf): sync anatomy/cerebrum/memory/hooks/token-ledger bookkeeping 2026-08-25 06:40:25 +00:00