fix: skip GC in sched_end_session when live_jobs allocation fails (OOM safety)

This commit is contained in:
Rongsong Shen 2026-04-30 05:49:49 +00:00
parent 5267d36a84
commit fb5127ad66

View file

@ -822,6 +822,12 @@ void sched_end_session(xce_scheduler_t* sched)
}
}
if (live_jobs == NULL) {
/* OOM: cannot safely GC — skip to avoid sweeping nodes still in use */
atomic_store_explicit(&sched->staging_merge_complete, 1, memory_order_release);
return;
}
/* Mark phase */
gc_clear_marks();
for (int i = 0; i < njobs; i++) {