feat(scheduler-core): wire builtin_fcfs as registered default picker (task 2.4)

Registers builtin_fcfs at scheduler startup and makes it the default
job_pick_plugin, replacing the hardcoded "xce_sched_fcfs" literal in
sched_job_picker() with a fail-loud lookup through sched_resolve_job_picker().
The picker thread now branches legacy job_elect_fn plugins (delegated
unchanged, preserving their self-contained wbuf-driven loop) from native
xce_job_picker_iface_t pickers (driven by a new per-session loop), and the
allocator now calls on_dispatch/on_pend for every picker as Req 1 AC 4
requires. Closes task 2.3's flagged picker/allocator concurrency race with a
mutex on fcfs_plugin_data_t, and adds cancel points to next_job().
This commit is contained in:
Rongsong Shen 2026-08-03 08:51:45 +00:00
parent fcb32a8b30
commit 7ee9a16f53
Signed by: rshen
SSH key fingerprint: SHA256:8Vf2pZ3h6rJa7EhGK+WaAQ9Mta/apZvteW6g9U/WKKk
11 changed files with 1036 additions and 54 deletions

View file

@ -118,6 +118,22 @@ sched_picker_fcfs_session_test = executable('sched_picker_fcfs_session_test',
dependencies: [scheduler_test_deps],
install: false)
# White-box test for wiring builtin_fcfs in as the registered default picker
# and removing the hardcoded "xce_sched_fcfs" picker string (scheduler-core
# spec, task 2.4). It #includes ../src/plugin.c, ../src/schedobj.c, and
# ../src/plugins/builtin_fcfs.c directly (same white-box pattern as the
# other picker tests) so it exercises the real plugin_register(),
# register_builtin_fcfs(), sched_set_default_job_pick_plugin(), and
# sched_resolve_job_picker() together -- not a re-implementation of any of
# them. See the file's own header comment for why sched_job_picker() itself
# (scheduler.c) is covered at the resolved-plugin level rather than by
# whole-file-including scheduler.c.
sched_picker_wiring_test = executable('sched_picker_wiring_test',
['test_picker_wiring.c'],
include_directories:[incdir],
dependencies: [scheduler_test_deps],
install: false)
# Register as meson tests so `meson test --suite scheduler` runs them all.
# detect_leaks=0 matches the suite convention (fixtures are not torn down).
test('scheduler test', scheduler_test, suite: 'scheduler',
@ -140,3 +156,5 @@ test('scheduler picker fcfs test', sched_picker_fcfs_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
test('scheduler picker fcfs session test', sched_picker_fcfs_session_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
test('scheduler picker wiring test', sched_picker_wiring_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])