--- id: "bug-1555" status: "fixed" status_updated: "2026-09-24" status_note: "" component: "controller" severity: "unknown" timestamp: "2026-08-13T07:40:00Z" last_seen: "2026-09-19T09:00:00Z" occurrences: 1 files: ["src/controller/worker.c"] tags: ["controller", "logging", "errno"] related: [] legacy: true --- # bug-1555: controller log spammed with '[ERROR] update_resval: Success' / 'update_resval: Resource… ## Description controller log spammed with '[ERROR] update_resval: Success' / 'update_resval: Resource temporarily unavailable' -- misleading, the real failure reason is never logged ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause update_resvals()/update_resval_list() called PERROR("update_resval") on rc<0, but PERROR (xce_perror -> xce_perror_) formats the process-global errno, not rc. update_resval()'s failure paths (key_find/zarray_put) return raw negative codes directly and never touch errno, so the logged message reflected whatever errno happened to be left over from an unrelated earlier syscall in the same event-loop iteration -- 0 ("Success") if nothing had touched it, or a stray EAGAIN if something had. The real reason (e.g. -ENOENT from an unregistered resource name) was silently discarded. Also fixed a second instance of the same errno-vs-rc bug in update_resval()'s r==NULL branch (was `return -errno;`, now `return -ENOENT;`, matching the identical branch in the sibling function mark_host_res()). ## Fix Replaced PERROR with a local log_update_resval_failure() helper that decodes the actual rc via xce_strerror_r(-rc, ...) and includes the resource name in the message. Regression test: test_update_resvals_logs_actual_rc_not_stale_errno (test_worker_join.c) sets errno=EAGAIN before the call and asserts the captured log contains neither "Success" nor "Resource temporarily unavailable", contains the resource name, and contains the real ENOENT string -- verified genuine RED (failed against the reverted old code with the exact reported symptom) before GREEN. ## Verification _Not recorded (migrated from buglog.json)._ ## References _Not recorded (migrated from buglog.json)._