save works

This commit is contained in:
Rongsong Shen 2026-03-04 18:18:53 +08:00
parent acfbec875b
commit 3f74f14687
38 changed files with 751 additions and 448 deletions

View file

@ -52,7 +52,7 @@ static int xce_apiserver_push_workers(cluster_t* c, endpoint_t* ep)
}
unlock_collect_workers(&wlist);
FREEUP(workers.workers);
return rc;
@ -88,7 +88,7 @@ static int xce_apiserver_push_jobs(cluster_t* c, endpoint_t* ep)
rc = xce_push_data_req(ep, c->myhost, &data, check_controller, c, 100);
unlock_collect_jobs(&jlist);
FREEUP(jobs.jobs);
return rc;
@ -394,10 +394,8 @@ static int apiserver_worker_change(int type, int situation, void* data,
break;
}
#if 0
free_resval_with_idx_list(&(w->host.resvals_to_sched),
w->host.nresvals_to_sched);
#endif
w->host.nresvals_to_sched = 0;
w->host.resvals_to_sched = NULL;
xlist_fini(&resvalist);
return 0;
@ -416,7 +414,13 @@ static int apiserver_worker_join(int type, int situation, void* data,
return 0;
}
lock(c->workermgr, RTTI_LOCK_WRITE);
rc = key_find(c->workermgr, (void*)name, (void**)&w);
if (w != NULL) {
reference(w);
}
unlock(c->workermgr);
if (rc < 0) {
return rc;
}
@ -425,9 +429,11 @@ static int apiserver_worker_join(int type, int situation, void* data,
return -ENOENT;
}
lock(w, RTTI_LOCK_READ);
rc = apiserver_worker_change(type, situation, data, c, w);
unlock(w);
/* FIXME: need to mark the jobs in this worker */
dereference(w);
return rc;
}