feat(scheduler-controller-msg-gap): store job rusage on the job + free leaked op payloads (tasks 5.5, 5.8; bug-765 G-5/G-3)
5.5 (Req 6 / G-5): the JOB_RUSAGE notify path called the plugin but never stored the usage data — xce_sched_job_t had no rusage field (UB-6.1 unmet). - Add xce_job_rusages_t* rusages to xce_sched_job_t. - New sched_apply_job_rusage() stores the report ON the job (ownership transferred), replacing any prior via free_JobRusages_ptr; -ENOENT unknown, -EINVAL NULL. Dequeue NULLs the request pointer on success; kill_sched_job releases job->rusages. 5.8 (G-3): sched_pend_update_killer left five new-op payloads on empty break cases — a per-message leak since ownership is transferred on enqueue. - Free each with the exact generated deep-freer: free_QueueConf_ptr, free_Resource_ptr[], free_ResourceVal_ptr[], free_ResValList_ptr, free_JobRusages_ptr. Safe: handlers nullify on enqueue, makeResource copies via makeInstance, dequeue copies values (no aliasing). Tests: sched_job_update_test 7/7 (3 update + 4 rusage), regression sched_test 15/15, ASAN clean (no bad-free/double-free). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5c1f715ccf
commit
93124c5601
6 changed files with 155 additions and 13 deletions
|
|
@ -93,6 +93,10 @@ typedef struct xce_sched_job_ {
|
|||
uint32_t maxtasks;
|
||||
xce_job_alloc_t* allocs;
|
||||
xce_job_account_t* accounts;
|
||||
/* Latest resource-usage report from the controller (Req 6 / bug-765 G-5).
|
||||
* Owned by the job: replaced on each JOB_RUSAGE update, freed in
|
||||
* kill_sched_job. NULL until the first rusage report. */
|
||||
xce_job_rusages_t* rusages;
|
||||
} xce_sched_job_t;
|
||||
|
||||
typedef struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue