feat(scheduler-dispatch-commit): controller resolves terminal dispatch failures to EXIT (task 3.2)
The two terminal-classified failure sites in dispatch_a_job_() (invalid allocation, queue-exec-info lookup failure) now actually resolve the job instead of leaving it stuck at PEND forever with a dangling reference to nowhere. Each site: lock(j, RTTI_LOCK_WRITE) -> genuinely calls xce_classify_dispatch_fail(site) and branches on the result (not a hardcoded assumption) -> mark_job_fail() under the lock (stage=0 routes apply_job_fail_transition() to JOB_STAT_EXIT) -> unlock(j) -> the existing dereference(j) (kept exactly where it was, not duplicated) -> the existing return code, unchanged. No notify_dispatch() added -- mark_job_fail()'s own hook chain is the sole notification for a terminal outcome per design.md; handle_jobdispatch()'s still-unconditional notify_dispatch() call is untouched (task 4.1's job). New test_dispatch_fail_terminal.c proves both sites resolve to JOB_STAT_EXIT with allocs left NULL, using a canary-reference technique to prove no reference over-release (job_t's real refcount has no test accessor). Independently reviewed and approved; applied the reviewer's one non-blocking fast-follow (arm the canary before the call under test, not after, so it's an independent proof rather than relying on other assertions to crash first) and re-verified with a clean incremental build. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Cxa1PmqAB5PyXfJaNvj8TN
This commit is contained in:
parent
d9aedc4b34
commit
8a4266ada4
5 changed files with 436 additions and 1 deletions
|
|
@ -98,6 +98,7 @@ extern void test_bug857_regression(void);
|
|||
extern void test_sched_admin_dispatch(void);
|
||||
extern void test_job_dispatch(void);
|
||||
extern void test_dispatch_commit(void);
|
||||
extern void test_dispatch_fail_terminal(void);
|
||||
|
||||
void setUp(void) { return; }
|
||||
|
||||
|
|
@ -265,6 +266,7 @@ int main(int argc, char* argv[])
|
|||
TEST(test_sched_admin_dispatch);
|
||||
TEST(test_job_dispatch);
|
||||
TEST(test_dispatch_commit);
|
||||
TEST(test_dispatch_fail_terminal);
|
||||
|
||||
return UNITY_END();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue