forked from lei.chen/myxce
feat: fill scheduler controller message gaps
Wire up 6 previously-stubbed message handlers in the scheduler:
resource dataset, resval dataset, job update notify, queue update
notify, resval update notify, and job rusage notify. Remove the
unreachable pushmsg branch (vtask_entry rewrites all pushmsg to
datamsg before the handler fires).
Changes by component:
- helper.h/helper.c: add xce_notify_event_name() for symbolic log names
- scheduler.h: add 5 new xce_sched_op_t values and matching union fields
- plugin.h/plugin.c: add plugin_job_rusage_hook_t and plugin_job_rusage_update()
- schedobj.c: add sched_update_existing_queue() with NULL/-ENOENT guards
- scheduler.c: wire 5 new dequeue cases; add sched_update_existing_job()
and static sched_op_name(); emit WARN log on handler failure
- handler.c: implement sched_handle_resources/resvals (dataset) and
sched_handle_sched_update_{job,queue,resvals}/job_rusage (notify);
remove dead sched_handle_jobpush/workerpush and pushmsg branch;
update TRACE logs to use symbolic name helpers
- test.c: 5 new unit tests covering notify event names, enum values,
and queue update NULL guard (15/15 pass)
This commit is contained in:
parent
f80839cd99
commit
3e652d2d7e
10 changed files with 534 additions and 39 deletions
|
|
@ -26,7 +26,12 @@ typedef enum {
|
|||
XCE_SCHED_OP_UPDATE_CONFIG,
|
||||
XCE_SCHED_OP_UPDATE_JOB,
|
||||
XCE_SCHED_OP_JSTATE_CHANGE,
|
||||
XCE_SCHED_OP_UPDATE_WORKER
|
||||
XCE_SCHED_OP_UPDATE_WORKER,
|
||||
XCE_SCHED_OP_UPDATE_QUEUE,
|
||||
XCE_SCHED_OP_UPDATE_RESOURCES,
|
||||
XCE_SCHED_OP_UPDATE_RESVALS_FULL,
|
||||
XCE_SCHED_OP_UPDATE_RESVALS,
|
||||
XCE_SCHED_OP_JOB_RUSAGE
|
||||
} xce_sched_op_t;
|
||||
|
||||
typedef struct {
|
||||
|
|
@ -46,6 +51,23 @@ typedef struct {
|
|||
uint64_t jobid;
|
||||
uint32_t state;
|
||||
} job_state_change;
|
||||
struct {
|
||||
xce_queue_t* queue;
|
||||
} queueupdate;
|
||||
struct {
|
||||
int nresources;
|
||||
xce_resource_t** resources;
|
||||
} resourceupdate;
|
||||
struct {
|
||||
int nvals;
|
||||
xce_resval_t** vals;
|
||||
} resvalfullupdate;
|
||||
struct {
|
||||
xce_resval_list_t* resvals;
|
||||
} resvalupdate;
|
||||
struct {
|
||||
xce_job_rusages_t* rusages;
|
||||
} job_rusage;
|
||||
} u;
|
||||
} xce_sched_update_request_t;
|
||||
|
||||
|
|
@ -105,6 +127,7 @@ extern xce_sched_user_t* sched_get_user(xce_scheduler_t*, char*);
|
|||
extern xce_sched_project_t* sched_get_project(xce_scheduler_t*, char*);
|
||||
extern int sched_add_job(xce_scheduler_t*, xce_sched_job_t*);
|
||||
extern int sched_add_queue(xce_scheduler_t*, xce_sched_queue_t*);
|
||||
extern int sched_update_existing_queue(xce_scheduler_t*, xce_queue_t*);
|
||||
extern int sched_add_user(xce_scheduler_t*, xce_sched_user_t*);
|
||||
extern int sched_add_worker(xce_scheduler_t*, xce_sched_worker_t*);
|
||||
extern int sched_add_project(xce_scheduler_t*, xce_sched_project_t*);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue