--- id: "bug-1785" status: "fixed" status_updated: "2026-09-24" status_note: "" component: "lib" severity: "unknown" timestamp: "2026-09-07T09:15:00Z" last_seen: "2026-09-19T09:00:00Z" occurrences: 1 files: ["src/lib/xcelimit.c (build_consumer)"] tags: ["scheduler", "limit-plugin", "capnp", "group-config", "default-semantics", "gitea-46"] related: ["bug-1784", "bug-1786", "bug-1787", "bug-1788", "bug-1789"] legacy: true gitea_issue: 46 gitea_synced_status: "fixed" --- # bug-1785: Found immediately after fixing bug-1784: with named-usergroup resolution working, a limit scoped… ## Description Found immediately after fixing bug-1784: with named-usergroup resolution working, a limit scoped to only SOME of the four dimensions (users.yaml's demo limits.yaml sets users+queues on ug1_normal_slots but never projects/hosts) still matched no one at all. ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause build_consumer() (xcelimit.c) is documented to default an unconfigured scope to the builtin "all" group (matching everyone) when g_config is NULL. But capnp encodes LimitConfig's users/queues/projects/hosts as embedded GROUPS, not nullable pointers (xceadmin's mapping.py: _build_membership_group() no-ops on an absent YAML key, but the embedded capnp struct is still present on the wire as an empty-but-non-NULL group) -- so an unconfigured scope arrives here as a non-NULL xce_group_config_t with zero members/ex_members, never as NULL. build_consumer()'s g_config!=NULL branch then builds a real, empty, UNNAMED group via makeGroup() -- a group that (per is_in_group()'s own logic) matches no one, the exact OPPOSITE of the intended "unrestricted" default. Every limit in this repo's demo limits.yaml configures only a subset of the four scopes, so every one of them was silently rejecting every job on its unconfigured dimensions. ## Fix FIXED (2026-09-07). build_consumer() now normalizes an empty-but-present g_config (members.count==0 AND ex_members.count==0) to NULL before the existing g_config!=NULL/NULL branch runs, restoring the documented "fall back to all" behavior for a genuinely-unconfigured scope. An operator who wants "no one" for a scope still has the builtin "empty" group to reference by name explicitly, so this doesn't remove any real capability. TDD: new test_build_consumer_empty_config_defaults_to_all (src/lib/testsuite/test_limit.c) -- builds a zero-valued xce_group_config_t{0}, asserts build_consumer() falls back to a group where is_in_group() matches an arbitrary name. Passes (313 lib tests, 0 failures). Full scheduler suite: 76/77 (pre-existing bug-1762). LIVE-VERIFIED as part of the same trace as bug-1784/1786/1787/1788 -- combined, these let match_limit() and instantiate_limit() run to completion for all 7 limits in limits.yaml on every job submission (previously it silently rejected on the FIRST unconfigured scope it hit). ## Verification _Not recorded (migrated from buglog.json)._ ## References - Related: bug-1784, bug-1786, bug-1787, bug-1788, bug-1789 - Gitea: #46