myxce/.wolf
Rongsong Shen a9feded88e
fix(scheduler): mid-round rejoin config push truncated live rounds (bug-1846 part 2)
sched_publish_retry_loop() calls sched_check_pending_rejoin() after every
successful publish -- inside the driver's decision-drain loop -- so after a
client-library reconnect the scheduler re-joins mid-round. The controller
answers every join (on_scheduler_join(), controller/sched.c) by re-pushing
config, workers and jobs. handler.c applied the config push synchronously
on the handler thread: sched_init_config() -> sched_init_queues() ->
builtin_fcfs on_queue_update(), which nulls the picker cursor when it
reinserts the queue the cursor rests on. next_job() then returned NULL and
the round ended with the rest of the queue never considered.

Evidence (scheduler-replay-20260923-085356.replay, temporary event-stream
diagnostics, reverted): 9 recorded rounds end after 11-12 decisions; every
one is followed by a workersPush + full 50-job jobsPush (the join's resync,
reporting just-dispatched jobs back as PEND), every full-length dispatching
round has none, and the config push never appears because it bypassed the
pending-update queue the recorder writes from -- which is also why replay
could not reproduce the truncation.

Fix (defer to the round edge, same direction as bug-1813): handler.c now
calls new sched_stash_config(), parking the Conf4Sched in new
xce_scheduler_t.pending_config under pending_config_lock (an older
unapplied push is freed). main.c's loop calls new
sched_apply_pending_config() before each round, running the unchanged
sched_init_config() strictly between sessions. sched_fini() frees a
never-applied push.

Tests:
- test_handlers.c: test_config_push_is_stashed_not_applied_on_handler_thread
  -- RED (sched_init_config called on the handler thread), GREEN after.
- new test_config_push_deferred.c (sched_config_push_deferred_test): real
  scheduler_req_handler() + real builtin_fcfs mid-session -- RED (next_job()
  returned NULL right after the push), GREEN (session walks the remaining
  jobs; configver unchanged until applied once between rounds).
- test_admin_request.c / test_job_array_expand.c / test_job_array_wire_e2e.c
  #include handler.c directly and get a link stub for sched_stash_config().
Full scheduler suite 87/87 (asan).

Not addressed: config pushes are still not written to a recording (a
replay spanning a config change won't see it); the ~100s reconnect churn
itself (see bug-1812/1813).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 06:30:34 +00:00
..
hooks chore(wolf): checkpoint buglog.json (1062 bugs) 2026-08-27 08:27:43 +00:00
.gitignore chore(wolf): checkpoint buglog.json (1062 bugs) 2026-08-27 08:27:43 +00:00
_scan-state.json Merge branch 'better_xce_build' into scheduler-framework 2026-09-08 03:09:53 +00:00
anatomy-index.json chore: persist OpenWolf state, controller-peers-env-fallback spec, and scheduler backlog notes 2026-09-23 03:19:52 +00:00
anatomy.md chore: persist OpenWolf state, controller-peers-env-fallback spec, and scheduler backlog notes 2026-09-23 03:19:52 +00:00
buglog.json fix(scheduler): mid-round rejoin config push truncated live rounds (bug-1846 part 2) 2026-09-24 06:30:34 +00:00
cerebrum.md fix(scheduler): 3 --sim-verify false positives + snapshot resreq_fp gap (bug-1844/1845/1772) 2026-09-23 13:40:16 +00:00
config.json docs: save scheduler-snapshot-job-allocation and xce-test-cli-ux spec docs, sync OpenWolf state 2026-08-28 06:30:37 +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(build): make xce-build.sh self-wrap into nix develop 2026-09-07 15:31:06 +00:00
memory.md save wolf status 2026-09-23 14:45:38 +08:00
OPENWOLF.md chore(wolf): checkpoint buglog.json (1062 bugs) 2026-08-27 08:27:43 +00:00
reframe-frameworks.md chore: checkpoint all prior work for clean state 2026-06-04 13:04:16 +00:00
STATUS.md chore(wolf): regenerate handoff, sync anatomy/memory bookkeeping 2026-09-13 09:43:21 +00:00