myxce/src
Rongsong Shen 3eba7c16bf
fix(controller): fail loud on scheduler/worker disconnect instead of relying on the reply-wait timeout (bug-1693)
Violates this project's own recorded Decision Log entry: "No client
reply-wait timeout as a fix for a hung request -- fail loud at the real
transport/source instead of masking with a deadline backstop."

OPCode_schedAdmin (cluster.c) and on_fetchfile (job.c, the worker proxy
-- cluster.c's own comment says schedAdmin "mirrors on_fetchfile's proxy
pattern", confirming one shared design mistake, not two independent
bugs) both blocked on a multi-second pthread_cond_timedwait, replying
"timeout" on expiry. handle_scheduler_leave()/handle_worker_leave() (the
actual disconnect handlers) only nulled the endpoint pointer -- neither
ever signaled the pending waiter, so a mid-wait disconnect was invisible
until the deadline lapsed. The timeout was the ONLY failure-detection
mechanism, exactly what the decision forbids.

Both sites already had a working signal function on their success path
(schedadmin_signal(), fetchfile_signal()) -- just never wired to the
disconnect handlers. Fixed by calling them from
handle_scheduler_leave()/handle_worker_leave() with a distinguishable
-ECONNRESET outcome, so the waiter wakes immediately on disconnect
instead of only on the deadline. Timeouts kept as defensive backstops
for a genuinely wedged peer that never disconnects cleanly either --
this fix is about not relying SOLELY on the timeout, not removing it.

schedadmin_signal_disconnect() must be called BEFORE handle_scheduler_leave()
acquires c->sched.lock -- the dispatch wait holds that same lock for its
entire duration, so signaling after acquiring it would deadlock.

Found by an /xce-audit-invariants controller pass (Decision Log fidelity
dimension). New test_fetchfile_disconnect.c plus extensions to
test_sched_admin_dispatch.c/test_sched_worker_change.c; RED/GREEN
independently verified against real elapsed-time assertions (pre-fix:
5001ms full-timeout wait; post-fix: <1s immediate wake). Full controller
suite: 1181 tests, 2 failures -- both the pre-existing, unrelated
bug-1561 overlayfs sandbox flake, confirmed via a clean meson-driven run.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgYRU3zDTqNGV5Jk8aiKLg
2026-08-25 14:13:26 +00:00
..
autoscaler support shared libxce(for api server) 2026-01-19 11:02:49 +08:00
configs fix(controller): close 6 data-safety races + apply-pump O(N^2) regression + boot TOCTOU 2026-08-16 10:20:02 +00:00
controller fix(controller): fail loud on scheduler/worker disconnect instead of relying on the reply-wait timeout (bug-1693) 2026-08-25 14:13:26 +00:00
docs update documents 2026-08-10 17:51:51 +08:00
frontend fix(apiserver): FilterRows must not route non-bitmask operators through bitmask matching (bug-1680) 2026-08-25 04:04:08 +00:00
include fix(controller): WAL_JOB_PREASON loses job.pend_reasons on replay (bug-1692) 2026-08-25 13:14:28 +00:00
lib fix(lib): thread from_host through the wire format and the job-submit interning object (bug-1676, gitea #44) 2026-08-24 15:14:42 +00:00
nixSupport feat(dirty-content-fingerprint): Nix flake computes fingerprint via self.narHash 2026-08-21 04:57:56 +00:00
scheduler fix(scheduler): invalidate stale builtin_fcfs picker cursors across calls (bug-1686) 2026-08-25 08:49:43 +00:00
schema fix(controller): WAL_JOB_RUSAGE loses job.run_usage on replay (bug-1690) 2026-08-25 10:53:32 +00:00
tools test(dirty-content-fingerprint): add Nix production path fingerprint check 2026-08-21 11:12:15 +00:00
worker fix(worker): job ids print human-readable format via fmt_jobid() (bug-1588) 2026-08-22 02:42:01 +00:00
xceadmin feat(dirty-content-fingerprint): xceadmin shows fingerprint in --version 2026-08-21 09:20:27 +00:00
flake.lock fix librtti package leak issue 2026-07-27 15:31:50 +08:00
flake.nix feat(dirty-content-fingerprint): Nix flake computes fingerprint via self.narHash 2026-08-21 04:57:56 +00:00
meson.build feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00
meson.options feat(dirty-content-fingerprint): add dirty_fingerprint meson option and C define 2026-08-21 03:54:37 +00:00