fix(scheduler): record config pushes, free hlimits lists, quiet benign picker WARN (bug-1847/1848/1849)

Follow-ups from the bug-1846 investigation.

bug-1847: config pushes never reached a .replay recording -- handler.c
applied them synchronously, bypassing the pending-update queue the
recorder writes from. With bug-1846's deferral they're now applied at a
round boundary on the driver thread, so sched_apply_pending_config()
writes a CONFIG_PUSH event via the existing sched_record_write_events()
(no-op when not recording), ahead of the round's other recorded events.
Test: test_config_push_deferred.c's test_applied_config_push_is_recorded
(RED: 0 events; GREEN: 1). Fidelity limit, pre-existing: replay applies
configPush through core_events.c's CONFIG_PUSH path, which doesn't re-run
groupmgr_load_configs()/plugin_config_update(), so a limits/groups change
still won't take effect in sim.

bug-1848: xce_sched_obj_t.hlimits was created with a NULL zarray killer
at all three constructors, so reset_sched_obj() and schedobj teardown
leaked the per-worker xlist_t match_job_host_limit_() callocs. New
kill_hlimits_list() (schedobj.c) frees the list, never its vres entries
(owned by the limit plugin); core_events.c and snapshot_load.c use
identical static local copies, since both avoid sharing helpers with
schedobj.c and several test binaries link them without it. Test:
test_limit_host_dedup.c's test_hlimits_zarray_releases_its_lists (RED:
killer NULL; GREEN).

bug-1849: every --sim run warned "failed to resolve job picker plugin ...
picker rebuild will be skipped". Benign: the snapshot is loaded before
the sim registers its picker, and sim_bootstrap_picker() replays the same
queue/job walk afterward. Downgraded to TRACE with an explanation.

Buglog also records bug-1850 (open): the ~100s reconnect churn behind
bug-1846 part 2 -- xcecli_retry_next() rotates/reconnects on every retry
(ETIMEDOUT after the 10s reply deadline, E_XCE_NOT_READY, redirects), so
a slow reply from a healthy primary forces a rejoin + full re-push.
Needs the live scheduler.log and a libxce spec.

Full scheduler suite 87/87 (asan). Replay of the captured file: same 184
mismatches, all attributable to the recording's pre-fix binary.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-09-24 07:00:07 +00:00
parent a9feded88e
commit ac033f4783
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
8 changed files with 228 additions and 8 deletions

View file

@ -252,9 +252,38 @@ static void test_repeated_host_attempts_stage_host_limit_once(void)
printf("test_repeated_host_attempts_stage_host_limit_once: PASS\n");
}
/* reset_sched_obj() (limit_job_election()'s config-version rebuild) and
* schedobj teardown release obj->hlimits through zarray_fini(), which only
* frees items when the zarray has an item killer. The per-worker entries
* are xlist_t's calloc'd by match_job_host_limit_(), and the zarray used to
* be created with a NULL killer, so every rebuild/teardown leaked one list
* per worker the job had tried. (The vres entries inside each list are
* owned by the limit plugin's instance table and must not be freed.) A
* direct LeakSanitizer check isn't usable here -- the fixture's own resreq
* parsing leaks independently -- so this pins the construction contract. */
static void test_hlimits_zarray_releases_its_lists(void)
{
xce_sched_job_t* job = sched_get_job(&(g_sched.core), JOB_ID);
TEST_ASSERT_NOT_NULL_MESSAGE(job, "runs after the dedup test's fixture");
TEST_ASSERT_EQUAL_PTR_MESSAGE(
(void*)kill_hlimits_list, (void*)job->schedobj->hlimits.killer,
"obj->hlimits must be created with kill_hlimits_list so "
"reset_sched_obj()/teardown free the per-worker lists");
/* and a reset must leave it reusable with the same killer */
reset_sched_obj(job->schedobj);
TEST_ASSERT_EQUAL_PTR((void*)kill_hlimits_list,
(void*)job->schedobj->hlimits.killer);
TEST_ASSERT_NULL(zarray_get(&(job->schedobj->hlimits), 0));
printf("test_hlimits_zarray_releases_its_lists: PASS\n");
}
int main(void)
{
UNITY_BEGIN();
RUN_TEST(test_repeated_host_attempts_stage_host_limit_once);
RUN_TEST(test_hlimits_zarray_releases_its_lists);
return UNITY_END();
}