merge job rusage and pending reason support

This commit is contained in:
Rongsong Shen 2025-12-16 14:36:28 +08:00
parent 30824ae5ea
commit cb0c7fe9e7
82 changed files with 4280 additions and 2561 deletions

View file

@ -143,10 +143,28 @@ static int do_reply_joblist(cluster_t* c, endpoint_t* ep,
xce_data_t getdata = { .table = request->body.getmsg->table,
.data = { .jobs = &jobdata } };
int rc = 0;
xce_match_t* match = request->body.getmsg->condition;
init_reply_by_req(&reply, request);
collect_jobs(c, (collect_check_fn_t)check_job_, &(jobdata.n_total),
&(jobdata.jobs));
if (match->type == MatchCondition_condition_matchjid) {
job_t* j;
jobdata.n_total = 0;
jobdata.jobs = NULL;
j = jobmgr_lockjob(&(c->jobmgr), match->condition.jobid, OBJREF_READ);
if (j != NULL) {
jobdata.jobs = (xce_job_t**)calloc(1, sizeof(xce_job_t*));
if (jobdata.jobs != NULL) {
jobdata.jobs[0] = &(j->job);
jobdata.n_total = 1;
}
}
} else {
collect_jobs(c, (collect_check_fn_t)check_job_, &(jobdata.n_total),
&(jobdata.jobs));
}
reply.status = 0;
reply.data_which = RequestReply_data_getdata;