myxce/src/include
lei.chen 0c8607345e merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits)
Merge origin/scheduler-framework into merge-sf-20260903 (97 commits on
ours: bug-1490/1494/1498/1509/1513/1521/1522 fixes, PEND-reason P1,
scheduler-agent Phase 2, bug-924 owner-pid shim).

Bookkeeping excluded per policy: .kiro/, .wolf/, CHANGES.md, reports/
(92 files dropped); .claude/ + CLAUDE.md keep ours.

Key theirs-side changes absorbed:
- bug-1938/1960: QUEUE_STAT_CLOSED no longer gates dispatch (closed
  queue refuses new submissions only; pending jobs still run) --
  supersedes our QUEUE_CLOSED preason on the dispatch path;
  sched_queue_status_reason drops that branch
- bug-1846: config push now stashes and applies between scheduling
  rounds (sched_stash_config/sched_apply_pending_config), applied at
  the same main-thread round boundary that preserves bug-1513
  serialization
- bug-1760: sched_check_pending_rejoin exposed +
  xcecli_is_connection_broken public predicate
- bug-1936: execuser/exechome/execcwd/exdata carried on submission
  (superset of our bug-1500 execuser fallback; our job-typed
  resolveExecUser removed as dead code)
- bug-1945~1962: apiserver auth hardening (HS256 pinning, default-
  secret rejection, logout revocation, bcrypt, RBAC) -- our API-key
  branch folded into controllers.ParseTokenClaims so both coexist
- bug-1736: rawRunUsage job run-usage fields in the Go model
- xce_test relocated src/controller/testsuite/test.c ->
  src/harness/test.c; controller suite split into
  controller_test.c + fixtures; their clitest fixtures spawn xce_test
  mid-suite under `meson test -j`

Ours preserved across the merge:
- PEND-reason P1 (codes 1-9, preason.h, job_preason machinery) --
  gate re-ported into their relocated allocator (sched_election.c)
  after plugin_job_election, with attach on the allocator thread
  only (bug-1521 race discipline)
- PEND-reason P0 main_reason semantics RECONCILED to theirs: the
  merge initially re-carried our first-detail-add-promotes-main_reason
  fallback in add_job_preason (4e2ac86), but their whole trace/verify
  stack treats "detail-only => main_reason 0" as a contract --
  sched_trace_capture counts main_reason as its own occurrence
  ("Expected 2 Was 3" in test_trace_capture), the outcome renderer
  prints "main reason: none" for detail-only PENDs (test_repl_trace_e2e),
  and the committed .replay/.sim_verify baselines encode main_reason=0
  (test_repl_trace_baseline byte compare, test_trace_equivalence
  off-vs-traced). The fallback is dropped from the shared lib;
  the user-visible "overall reason" survives as an API-layer view:
  rawJobToModel (convert_pure.go) promotes the first detail row to
  main_reason_name when main_reason is 0 (main_reason VALUE marshals
  unchanged). add_job_preason keeps only the NULL-reasons guard
- bug-1498: sched_job_is_ready rejects non-PEND/suspended jobs
- bug-1490/1781: xce_jobctrl_t.action as capnp union discriminant
  (their jobCtrlUnionDiscriminant, same semantics)
- xcecli typed PendingReason field (53c00834), bug-1522 reconnect
  resend, xcecli_force_reconnect + their is_connection_broken both
  exported in client.h/libclient
- t1/t2/t3 test-node hostconfig in src/configs/hosts.yaml (bug-1494),
  /xce/v1/events + /xce/v1/apikeys whitelist routes (agent Phase 2)
- lib ASAN_OPTIONS=detect_leaks=0 test env + their oom-test block
- drop-audit: our bug-1504 fix covered by their bug-1680 (no action)

bug-924 follow-up (replaces the 67f3f6ad scratch-dir wipe): the
take-theirs audit's one "drop" was re-evaluated and REVERTED instead of
re-applied -- a global `find /tmp -name 'xce_*' -exec rm -rf` at suite
start/exit races the LIVE /tmp/xce_* fixtures of sibling suites under
`meson test -j` (harness_unit_test's clitest fixtures spawn xce_test as
a child mid-suite; the wipe destroyed the parent's fixtures ->
test_test_cli failures). Coverage instead:
- mkdtemp_clean shim gains mkdtemp_clean_mark/sweep_since
  (testsuite_support/mkdtemp_clean.[ch])
- new case_scratch_sweep.[ch]: aggregate runners (controller_test.c,
  harness_test.c -- hundreds of cases per process) call
  case_scratch_sweep_begin/_end_ok from setUp/tearDown; a PASSED case's
  dirs are swept immediately in tearDown (after engine reaping), FAILED
  cases keep their dirs for post-mortem; XCE_MKDTEMP_KEEP_ALL=1
  disables. One full controller_unit_test run was observed to leak 12G+
  to ENOSPC without this, cascading into unrelated "Expected Non-NULL"
  failures
- harness_unit_test_deps links the shim library as well

Test reconciliations on adopt:
- core-ready-gates: sched_queue_is_ready now gates only
  INACT_ADMIN|INACT_WINDOW (bug-1938/1960); CLOSED queues elect --
  covered end-to-end by test_queue_admin_control.c
- test_worker_resync: the 4 restart-replay RUN assertions predate the
  bug-1509 B3 marking (8858afed) landing on the same lineage; replayed
  RUN jobs now assert RUN|UNKWN|TRANSIENT (TWR_ASSERT_REPLAYED_RUN);
  terminal DONE/EXIT assertions unchanged
- convert_pure.go: our job-typed resolveExecUser deleted (superseded
  by their bug-1780/1936 two-arg version)
- test_preason: the 3 P0-promotion assertions reverted to the
  detail-keeps-main-0 contract; new tests cover limit-code detail
  rows and explicit-main-wins-over-later-details; apiserver
  convert_test.go gains the detail-only name-promotion cases

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-10-14 05:17:03 +00:00
..
xce fix(controller): reject submissions to closed or unknown queues (bug-1960) 2026-10-10 10:38:42 +00:00
attrs.h improve xkvmgr and testsuite for scheduler 2026-02-26 14:39:12 +08:00
bitset.h - introduce bitset 2026-02-13 11:01:33 +08:00
byteorder.h fix: ha_seed_jitter loop-until-full partial read; byteorder.h musl portability 2026-05-13 14:18:43 +00:00
client.h merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits) 2026-10-14 05:17:03 +00:00
clusterconfig.h feat(worker-rejoin-resync): define reconciliation wire protocol (task 1.1) 2026-09-01 08:44:33 +00:00
config.h chore(include): drop the unused job-ID regex macros 2026-10-02 09:36:54 +00:00
configobj.h save works 2026-03-03 16:49:26 +08:00
ctrl_metrics.h feat: P3-7 ctrl_metrics — 7 atomic counters/gauges + descriptor table + persist wiring 2026-05-08 00:04:06 +00:00
dataq.h fix(lib): keep per-endpoint message order in the vtask dispatcher (bug-1864) 2026-09-25 14:44:14 +00:00
delay.h fix(lib): normalize delaymgr to one CLOCK_MONOTONIC ms timescale, fixing seconds-task starvation 2026-07-02 03:40:08 +00:00
group.h fix(scheduler): fix limit-plugin usergroup/scope/error-code cascade (gitea#46) 2026-09-07 12:44:16 +00:00
helper.h feat: fill scheduler controller message gaps 2026-05-12 07:01:52 +00:00
hook.h feat: xce_disable_hook() + _Atomic hook_fn_t + NULL-slot reuse (P1-2a) 2026-05-07 13:55:42 +00:00
htab.h reformat code and job array 2025-11-07 16:14:27 +08:00
idgen.h feat(job-array-one-based-index): idgen allocates ordinary IDs only (task 9.1) 2026-10-01 13:17:59 +00:00
jobj.h fix(controller): job_ctrl lock/reference and dispatch retry requeue (bug-448, bug-1626, bug-1631) 2026-09-27 03:05:20 +00:00
kv.h feat: implement kvmgr_capture_keys for lock-free checkpoint serialization (P0-14a) 2026-05-07 11:07:41 +00:00
kvmgr.h fix(job-array-single-wal-record): close bug-1443's bulk-insert partial-visibility gap 2026-07-16 15:08:02 +00:00
misc.h 1st workable scheduler with resource from controller 2025-12-31 15:50:52 +08:00
myconf.h fix(config): serialize load_primary_config against concurrent invocations (bug-1476) 2026-07-28 08:13:54 +00:00
mylock.h feat(libxce-failover): reconnect recovery — ctx ERR->RUN reset + stale wbuf drain (fixes post-failover EINVAL) (task 3.2) 2026-06-17 03:36:24 +00:00
netio.h fix(lib): reconnect from an endpoint's own task neither waits nor leaks old replies (bug-1917) 2026-10-08 03:03:09 +00:00
objs.h update controller code 2025-11-05 16:58:57 +08:00
ordq.h pass pend reason back to controller 2025-12-23 15:29:26 +08:00
persist.h fix(controller): release the promotion fence once a truncated-boot node has caught up (bug-1919) 2026-10-04 09:14:48 +00:00
preason.h merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits) 2026-10-14 05:17:03 +00:00
qobj.h save works 2026-03-02 12:14:30 +08:00
repl.h fix(ha): close permanent quorum-loss deadlock on log-conflicted standby (bug-1479) 2026-07-29 04:11:32 +00:00
request.h feat: acknowledged job start/finish/fail reports (bug-1741) 2026-09-27 06:47:47 +00:00
resobj.h fix(scheduler): re-pushed resource definitions are not errors (bug-1854) 2026-09-25 15:09:49 +00:00
resreq.h fix(lib): a malformed select in a resreq fails the parse instead of being dropped (bug-1887) 2026-09-29 10:26:35 +00:00
typemap.h fix(controller): CtrlHelloRequest.key Data field crashed HA leader election (bug-1835) 2026-09-21 03:51:48 +00:00
utils.h merge: sync Rongsong's scheduler-framework (c5b172c7..3442a57d, 781 commits) 2026-10-14 05:17:03 +00:00
vtaskmgr.h fix(lib): reconnect from an endpoint's own task neither waits nor leaks old replies (bug-1917) 2026-10-08 03:03:09 +00:00
wal_types.h fix(controller): persist a failed job's finish_time through WAL_JOB_FAIL (bug-1747) 2026-09-26 09:33:55 +00:00
wobj.h save works 2026-03-02 12:14:30 +08:00
xcealloc.h feat(libxce-alloc-preason-equality): public alloc_eq/host_alloc_eq/job_alloc_eq with first-difference description (task 2.1) 2026-09-28 09:35:08 +00:00
xceapi.h feat: acknowledged job start/finish/fail reports (bug-1741) 2026-09-27 06:47:47 +00:00
xcectx.h Merge branch 'working' into job_peek_lchen 2026-07-22 13:57:25 +08:00
xcelimit.h feat(scheduler-sim-diagnostics): add fmt_limit_units() sibling (task 8.1) 2026-09-20 05:09:09 +00:00
xcelist.h remove extralib 2026-09-04 11:24:43 +08:00
xcelog.h use clang-format to format code 2025-11-25 14:58:09 +08:00
xlist.h support limit 2026-01-12 15:27:54 +08:00
xstring.h save works 2026-03-03 16:49:26 +08:00
xvec.h using xvec related api in scheduler 2026-01-16 18:21:37 +08:00
zarray.h fix(job-array-single-wal-record): close bug-1443's bulk-insert partial-visibility gap 2026-07-16 15:08:02 +00:00