While live-verifying gitea#46, found and fixed a cascade of 5 previously undetected bugs that together made every usergroup-scoped limit in limits.yaml silently non-functional: - Named usergroups/hostgroups (users.yaml/hosts.yaml) were never registered into the scheduler's group managers (groupmgr_add() had zero production callers), so any limit referencing one by name could never resolve real membership. - An unconfigured limit scope (e.g. no "projects:") arrived as an empty-but-present capnp group, not NULL, so build_consumer() built a real empty group (matching no one) instead of falling back to "all". - Three separate call sites conflated key_find()'s negative "not found" return with a real error, short-circuiting before ever reaching the "instantiate on first use" logic right below them -- the same defect class already fixed once before in this codebase (bug-1495). - Two call sites passed &(sched->core.resmgr) where a plain handle was expected, one level of indirection too many, causing RTTI's key_find() to reject it as an invalid handle. All five are live-verified: fresh cluster deploys now correctly match and instantiate usage tracking for all 7 limits in limits.yaml on every job submission, reproduced across multiple independent from-scratch redeploys. A 6th, architecturally distinct issue remains open (bug-1789, logged, not fixed): sched_fill_limit_requests() computes a job's consumption of a slots-scoped global limit by reading the wrong request vector, so the numeric cap itself still never binds. This needs a design decision on intended cross-scope semantics, not a mechanical fix, so it's left for a follow-up. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hb6Edtj4KbS8CrgEWYdA2E
26 lines
868 B
C
26 lines
868 B
C
#if !defined(_GROUP_H_)
|
|
|
|
#define _GROUP_H_ 1
|
|
|
|
#include <rtti.h>
|
|
|
|
#include "kvmgr.h"
|
|
#include "xce/types.h"
|
|
#include "xlist.h"
|
|
#include "zarray.h"
|
|
|
|
extern xce_group_t* makeGroup(var, xce_group_config_t*, char*);
|
|
extern int groupmgr_init(var*, int, int);
|
|
extern void groupmgr_fini(var);
|
|
extern int groupmgr_add(var, xce_group_t*);
|
|
extern int groupmgr_load_configs(var, int, xce_group_config_t**);
|
|
extern xce_group_t* groupmgr_lock(var, char*, int);
|
|
extern void groupmgr_del(var, xce_group_t*);
|
|
extern int groupmgr_iter(var, xlist_t*, void*);
|
|
extern xce_group_t* build_group(var, xce_group_config_t*, char*);
|
|
extern int is_in_group(xce_group_t*, char*);
|
|
extern xce_group_t* get_group(var, char*);
|
|
extern int fmt_group(char*, int, xce_group_t*);
|
|
extern int is_group_all(xce_group_t*);
|
|
|
|
#endif
|