myxce/src
Rongsong Shen ebe691c3ed
fix(bug-1731): fire HOOK_DETAIL_JOB_START/JOB_EXIT on WAL apply
apply_committed_entry() (persist.c), the single seam that applies every
committed WAL entry, only ever fired the generic HOOK_DETAIL_JOB_UPDATE
for job-state changes -- HOOK_DETAIL_JOB_START/JOB_EXIT were
permanently dead code, since job.c only ever fires them at
HOOK_BEFORE_EVENT (for WAL-append purposes). This left sched_job_start_
fun/sched_job_exit_fun (sched.c) and apiserver_job_start_fun/
apiserver_job_exit_fun (apiserver.c) unreachable, and the Go apiserver's
already-wired OnJobFinished handler permanently starved of data -- a
finished job's state could stay stuck (e.g. showing RUN) in the
scheduler's own view and the apiserver never learned a job finished.

The wire format was already enriched by bug-1697/bug-1689 with the
pidinfo/exit_info data these hooks need, so this closes the gap rather
than requiring new wire work. WAL_JOB_FINISH now fires
HOOK_DETAIL_JOB_EXIT; WAL_JOB_START now fires HOOK_DETAIL_JOB_START,
gated on a call-scoped decode flag rather than the transition result
(WAL_JOB_START applies as a no-op duplicate for every real job in
production per bug-1697, so gating on the transition result would make
it dead code again). WAL_JOB_FAIL -> HOOK_DETAIL_JOB_FAIL has the same
gap and is left as a follow-up.

Also includes this investigation's supporting changes: a DEBUG3 log-
retention bump (main.c, both controller and scheduler) so race-condition
evidence survives a live burst without rotating out, and DEBUG3-gated
diagnostic trace logging at the two points a job-update notification
can fire or silently drop (job.c, sched.c).

Live-verified end to end on a real deployed cluster: scheduler-side
sched_job_state_change now fires for RUN and EXIT states, and the
apiserver's OnJobFinished -- previously never invoked in production --
now correctly updates job status on completion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019QxaSzHRB7pmYFp4cVnwkA
2026-08-29 11:29:10 +00:00
..
autoscaler support shared libxce(for api server) 2026-01-19 11:02:49 +08:00
configs fix(controller): close 6 data-safety races + apply-pump O(N^2) regression + boot TOCTOU 2026-08-16 10:20:02 +00:00
controller fix(bug-1731): fire HOOK_DETAIL_JOB_START/JOB_EXIT on WAL apply 2026-08-29 11:29:10 +00:00
docs update documents 2026-08-10 17:51:51 +08:00
frontend fix(bug-1731): fire HOOK_DETAIL_JOB_START/JOB_EXIT on WAL apply 2026-08-29 11:29:10 +00:00
include feat(scheduler-snapshot-job-allocation): add dup_job_alloc deep-copy primitive 2026-08-27 12:07:27 +00:00
lib fix(bug-1733): fix heap-use-after-free race in vtask_enq() 2026-08-29 11:28:48 +00:00
nixSupport feat(dirty-content-fingerprint): Nix flake computes fingerprint via self.narHash 2026-08-21 04:57:56 +00:00
scheduler fix(bug-1731): fire HOOK_DETAIL_JOB_START/JOB_EXIT on WAL apply 2026-08-29 11:29:10 +00:00
schema fix(controller): WAL_JOB_RUSAGE loses job.run_usage on replay (bug-1690) 2026-08-25 10:53:32 +00:00
tools fix(deploy-ha): guard against double-launching a live HA deploy 2026-08-27 07:59:24 +00:00
worker fix(worker): job ids print human-readable format via fmt_jobid() (bug-1588) 2026-08-22 02:42:01 +00:00
xceadmin fix(xceadmin): retry transient scheduler-admin failures after a redirect (bug-1713, bug-1715) 2026-08-27 08:26:33 +00:00
flake.lock fix librtti package leak issue 2026-07-27 15:31:50 +08:00
flake.nix feat(dirty-content-fingerprint): Nix flake computes fingerprint via self.narHash 2026-08-21 04:57:56 +00:00
meson.build feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00
meson.options feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00