myxce/.wolf
lei.chen ee7dee0ed4 fix(scheduler): stop re-dispatching running jobs (bug-1498) + resval double-free (bug-1497)
bug-1498 (re-dispatch): sched_job_is_ready() was a stub returning 1, so any
job lingering in the fcfs pendJobs queue was always elected. A dispatched job
was never marked non-PEND (the controller defers its schedStartJob notify to
the not-yet-implemented apply pump, controller/job.c), so fcfs_update_job
re-enqueued it on every job update and the election thread re-dispatched the
running job — the worker got conflicting signals and the job was SIGTERM'd.

- sched_job_is_ready: elect only PEND, non-suspended jobs
- sched_commit_decision (dispatch): mark the job JOB_STAT_RUN on dispatch so
  it leaves the PEND set and is no longer re-electable
- fcfs_update_job: dedup via ordq_peek before enqueue

bug-1497 (double-free): sched_update's resval paths transferred ownership of
rv->val to sharedInst/w->resvals but left the request pointer set, so
sched_pend_update_killer double-freed it -> use-after-free in
build_host_eval_ctx. Clear rv->val = NULL on transfer.

Tests: new scheduler/testsuite/test_redispatch.c (8 cases): sched_job_is_ready
PEND gating + dispatch-commit marks the job RUN. Full scheduler meson suite
green. Live-verified: a `sleep 60` job is elected exactly once, runs the full
duration and exits 0 (`completed successfully`); before the fix it was
re-dispatched at ~11s and killed (SIGTERM 143).

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-04 01:20:38 +00:00
..
hooks add wolf state 2026-07-31 17:42:34 +08:00
anatomy.md docs(scheduler-agent): update design doc with cluster verification results 2026-08-01 09:54:49 +00:00
buglog.json fix(scheduler): stop re-dispatching running jobs (bug-1498) + resval double-free (bug-1497) 2026-08-04 01:20:38 +00:00
cerebrum.md chore(wolf): record rule — never push to Rongsong's branch without permission 2026-08-01 03:41:47 +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 chore: sync OpenWolf state (buglog, cerebrum, memory, anatomy) 2026-07-03 02:41:41 +00:00
daemon.log chore: sync OpenWolf state (buglog, cerebrum, memory, anatomy) 2026-07-03 02:41:41 +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 fix(scheduler): put_resvals treats resource idx 0 as invalid → SEGV 2026-08-03 06:53:14 +00:00
OPENWOLF.md chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
reframe-frameworks.md chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
suggestions.json chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
token-ledger.json add wolf state 2026-07-31 17:42:34 +08:00