--- id: "bug-447" status: "fixed" status_updated: "2026-09-24" status_note: "" component: "controller" severity: "leak" timestamp: "2026-06-12T09:30:00Z" last_seen: "2026-09-19T09:00:00Z" occurrences: 1 files: ["src/controller/queue.c"] tags: ["production-gap", "queue_ctrl", "worker_ctrl", "job_ctrl", "key_find", "wal", "ha-commit-barrier-rollout", "red-finding"] related: [] legacy: true --- # bug-447: queue_ctrl/worker_ctrl append NO WAL entry and reply status 1 on success; job_ctrl also returns 1… ## Description queue_ctrl/worker_ctrl append NO WAL entry and reply status 1 on success; job_ctrl also returns 1 (key_find found-rc leak) ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause key_find (xkvmgr_find, lib/kvmgr.c:130-151) returns 1 when the key is found. queue_ctrl (queue.c:60), worker_ctrl (worker.c:643) and job_ctrl (job.c:314) store it in rc and never reset it: the 'if (rc == 0)' AFTER_EVENT hook gate is skipped (no WAL_QUEUE_CTRL / WAL_WORKER_CTRL append on the found path) and the requester reply carries status 1 instead of 0. Production gap discovered by task-3.1 RED tests; queue/host control state changes are currently never persisted or replicated. ## Fix FIXED (task 3.2, 2026-06-12): normalized the key_find found-rc to 0 in queue_ctrl (queue.c), worker_ctrl (worker.c) and job_ctrl (job.c) after the miss/-ENOENT checks, so the AFTER_EVENT hook gate fires (WAL append + replication) and the handlers' commit-barrier pattern sees 0. Handlers do_jobcontrol_op/do_queuecontrol_op/do_hostcontrol_op now run persist_commit_barrier(&c->persist, 0) on rc==0 before replying; handle_worker_join barriers between AFTER_EVENT and the success reply. All 12 test_commit_barrier_reply tests PASS; full controller suite 0 FAIL. ## Verification _Not recorded (migrated from buglog.json)._ ## References _Not recorded (migrated from buglog.json)._