Skip to content
Snippets Groups Projects
Commit 44dc3d9c authored by Moe Jette's avatar Moe Jette
Browse files

Kill batch job script as part of the KILL_JOB request processing.

It was formerly just killing the job step processes.
parent 016671c5
No related branches found
No related tags found
No related merge requests found
...@@ -674,11 +674,21 @@ _kill_all_active_steps(uint32_t jobid, int sig) ...@@ -674,11 +674,21 @@ _kill_all_active_steps(uint32_t jobid, int sig)
int step_cnt = 0; int step_cnt = 0;
while ((s = list_next(i))) { while ((s = list_next(i))) {
if ((s->jobid == jobid) && (s->stepid != NO_VAL)) { if (s->jobid != jobid) /* wrong job */
debug2("sending signal %d to job %d.%d (pg:%d)", continue;
if ((s->stepid == NO_VAL) && /* batch job script */
((sig != SIGKILL) || (s->sid <= 0)))
continue;
step_cnt++;
if (s->stepid == NO_VAL) {
debug2("sending signal %d to job %u (pg:%d)",
sig, jobid, s->sid);
if (kill(-s->sid, sig) < 0)
error("kill jid %d sid %d: %m", s->jobid, s->sid);
} else {
debug2("sending signal %d to job %u.%u (pg:%d)",
sig, jobid, s->stepid, s->sid); sig, jobid, s->stepid, s->sid);
shm_signal_step(jobid, s->stepid, sig); shm_signal_step(jobid, s->stepid, sig);
step_cnt++;
} }
} }
list_destroy(steps); list_destroy(steps);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment