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 |
||
|---|---|---|
| .. | ||
| settings | ||
| specs | ||
| steering | ||