fix(scheduler): mirror plugin_begin_session/plugin_end_session into sim-mode driver (bug-1681)
sim_loop.c never called plugin_begin_session()/plugin_end_session() at its round boundary, unlike driver.c's normal-mode round -- a driver- equivalence gap found by an /xce-audit-invariants scheduler pass. Currently inert (sim mode's only reachable picker, builtin_fcfs, leaves both hooks NULL) but structurally identical to bug-1613's class of bug. Relocated plugin_begin_session()/plugin_end_session() from an implicit xce_scheduler_t* to xce_sched_core_t* directly (mirroring sched_account_jobs()'s prior relocation) -- their bodies never touched anything beyond core->plugins, so driver.c's comment claiming they "needed the full xce_scheduler_t*" was itself stale. sim_loop.c now calls both, same relative position as driver.c. A full-tree grep (done after the first build attempt failed on an untouched file) turned up a third live call site in scheduler.c's legacy sched_begin_session()/ sched_end_session(), plus four testsuite files with their own stub definitions of the same functions -- all updated to match the new signature. Extended test_sim_session_ordering.c's existing bug-1613 regression tests with new plugin_begin_session()/plugin_end_session() spies (call-count + session_active-window proof, same technique as the existing sched_account_jobs spy). RED/GREEN independently verified: temporarily disabled the two new call sites, confirmed both new assertions fail (Expected 2 Was 0 / Expected 1 Was 0), restored, reconfirmed green. Full scheduler suite: 51/52 green, the one failure is the pre-existing unrelated bug-1560 sandbox flake. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AgYRU3zDTqNGV5Jk8aiKLg
This commit is contained in:
parent
6d2668ced3
commit
6400f96d9d
12 changed files with 248 additions and 54 deletions
|
|
@ -60,6 +60,12 @@ typedef struct {
|
|||
* -- same idiom as cluster_t across myconf.h/persist.h/ha.h/cluster_def.h. */
|
||||
typedef struct xce_job_picker_iface_s xce_job_picker_iface_t;
|
||||
|
||||
/* xce_sched_core_t is defined in core.h -- forward-declared here (re-declared
|
||||
* again, harmlessly, near plugin_register_core()'s own declaration below)
|
||||
* so plugin_begin_session()/plugin_end_session() can be declared against it
|
||||
* ahead of that later block. */
|
||||
typedef struct xce_sched_core_s xce_sched_core_t;
|
||||
|
||||
typedef struct {
|
||||
char* name;
|
||||
void* sched;
|
||||
|
|
@ -89,8 +95,17 @@ extern int plugin_queue_update(void*, xce_sched_queue_t*);
|
|||
extern int plugin_job_update(void*, xce_sched_job_t*);
|
||||
extern int plugin_worker_update(void*, xce_sched_worker_t*);
|
||||
extern int plugin_job_state_change(void*, xce_sched_job_t*, uint32_t);
|
||||
extern int plugin_begin_session(void*);
|
||||
extern int plugin_end_session(void*);
|
||||
/* plugin_begin_session()/plugin_end_session() - relocated to xce_sched_core_t*
|
||||
* (bug-1681, mirroring sched_account_jobs()'s identical scheduler-sim-
|
||||
* decision-parity task 1.1 relocation): the per-plugin begin/end_session_fn
|
||||
* iteration only ever touches core->plugins, never anything else on
|
||||
* xce_scheduler_t* -- so, like plugin_register_core() below, these are
|
||||
* callable from a driver with no xce_scheduler_t* (the simulation driver).
|
||||
* See driver.c's xce_sched_driver_run_normal_mode_round() for the normal-
|
||||
* mode call site and sim_loop.c's sched_sim_driver_run() for the mirrored
|
||||
* simulation-mode one. */
|
||||
extern int plugin_begin_session(xce_sched_core_t*);
|
||||
extern int plugin_end_session(xce_sched_core_t*);
|
||||
extern int plugin_commit_decision(void*, xce_decision_t*);
|
||||
extern int plugin_prepare_allocation(void*, xce_sched_ctx_t*);
|
||||
extern int plugin_job_election(void*, xce_sched_job_t*);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue