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
|
|
@ -1,4 +1,5 @@
|
|||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "controller.capnp.h"
|
||||
|
|
@ -330,3 +331,55 @@ char* xce_dataset_table(int table)
|
|||
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
char* xce_notify_event_name(int event)
|
||||
{
|
||||
static char buf[32];
|
||||
|
||||
switch (event) {
|
||||
case NotifyData_data_jobPidInfo:
|
||||
return "jobPidInfo";
|
||||
case NotifyData_data_jobFailInfo:
|
||||
return "jobFailInfo";
|
||||
case NotifyData_data_jobDispatchFail:
|
||||
return "jobDispatchFail";
|
||||
case NotifyData_data_jobFinishInfo:
|
||||
return "jobFinishInfo";
|
||||
case NotifyData_data_schedStartJob:
|
||||
return "schedStartJob";
|
||||
case NotifyData_data_schedExitJob:
|
||||
return "schedExitJob";
|
||||
case NotifyData_data_schedFailJob:
|
||||
return "schedFailJob";
|
||||
case NotifyData_data_schedUpdateJob:
|
||||
return "schedUpdateJob";
|
||||
case NotifyData_data_schedUpdateResvals:
|
||||
return "schedUpdateResvals";
|
||||
case NotifyData_data_stoppedJob:
|
||||
return "stoppedJob";
|
||||
case NotifyData_data_resumedJob:
|
||||
return "resumedJob";
|
||||
case NotifyData_data_ckptinfo:
|
||||
return "ckptinfo";
|
||||
case NotifyData_data_schedUpdateQueue:
|
||||
return "schedUpdateQueue";
|
||||
case NotifyData_data_taskPidInfo:
|
||||
return "taskPidInfo";
|
||||
case NotifyData_data_taskFailInfo:
|
||||
return "taskFailInfo";
|
||||
case NotifyData_data_taskFinish:
|
||||
return "taskFinish";
|
||||
case NotifyData_data_postDoneJob:
|
||||
return "postDoneJob";
|
||||
case NotifyData_data_schedJobRusages:
|
||||
return "schedJobRusages";
|
||||
case NotifyData_data_updateJob:
|
||||
return "updateJob";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
snprintf(buf, sizeof(buf), "UNKNOWN(%d)", event);
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue