merge: sync Rongsong's scheduler-framework (122 commits, 070c7869..f01ae353)

Introduces WAL replay field-completeness fixes (bug-1687..1697, 1731), scheduler snapshot job-allocation restore, heap UAF fixes (vtask_enq, xcealloc, builtin_fcfs, limit), HA fixes (bug-1694/1695/1696), xceadmin retry, worker signal-exit severity, and their test suites.

Conflicts resolved keeping both sides (drop-audit passed):
- worker.c: mark_worker_jobs_exit (bug-1509 B1) + fetchfile_signal_worker_disconnect (bug-1693)
- handler.go: DefaultBroker.Publish (EventJobFinished) + bug-1731 logging
- config_repl.c / test_config_repl.c: our ns-resolution comment / unique-tmpdir
- test_dispatch_commit.c: both B3-UNKWN and bug-1697 start_time assertions

Excluded Rongsong's bookkeeping per policy: .wolf/, .kiro/, CHANGES.md, reports/;
.claude/ + CLAUDE.md kept ours (his settings.json has machine-absolute paths).
This commit is contained in:
lei.chen 2026-08-31 14:24:17 +00:00
commit 3b6f53bb65
168 changed files with 20744 additions and 568495 deletions

View file

@ -87,9 +87,19 @@ func (h *DefaultHandler) OnJobDeleted(jobid uint64) {
DefaultBroker.Publish(Event{Type: EventJobDeleted, JobID: jobid})
}
// bug-1731: previously permanently starved of data -- apply_committed_entry()
// (persist.c) never fired the controller-side HOOK_DETAIL_JOB_EXIT this
// method's C caller (apiserver_job_exit_fun -> NotifyData_data_jobFinishInfo)
// depends on, so OnJobFinished was live, wired, and correct but never once
// invoked in production. Logs at Info (mirroring this file's existing
// "job array push received and expanded" convention) so a finished job's
// terminal-state push to the apiserver is directly observable in
// apiserver.log, not just inferable from store state.
func (h *DefaultHandler) OnJobFinished(jobid uint64, exitCode int) {
existing, ok := store.Jobs.Get(jobid)
if !ok {
logger.Info("OnJobFinished: jobid not found in store, ignoring",
zap.Uint64("jobid", jobid), zap.Int("exit_code", exitCode))
return
}
if exitCode == 0 {
@ -99,6 +109,10 @@ func (h *DefaultHandler) OnJobFinished(jobid uint64, exitCode int) {
}
store.Jobs.Put(jobid, existing)
DefaultBroker.Publish(Event{Type: EventJobFinished, JobID: jobid, ExitCode: exitCode})
logger.Info("OnJobFinished: job status updated",
zap.Uint64("jobid", jobid), zap.Int("exit_code", exitCode),
zap.Int("job_status", existing.JobStatus))
}
func (h *DefaultHandler) OnQueueUpdated(queue *models.QueueInfo) {