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

Report an error when trying to cancel a job that is already done

parent ba21f015
No related branches found
No related tags found
No related merge requests found
......@@ -146,7 +146,8 @@ _verify_job_ids (void)
if (job_ptr[i].job_id == opt.job_id[j])
break;
}
if (i >= job_buffer_ptr->record_count) {
if ((job_ptr[i].job_state >= JOB_COMPLETE) ||
(i >= job_buffer_ptr->record_count)) {
if (opt.step_id[j] == SLURM_BATCH_SCRIPT)
error("Kill job error on job id %u: %s",
opt.job_id[j],
......@@ -269,7 +270,8 @@ _cancel_jobs (void)
job_ptr = job_buffer_ptr->job_array ;
/* Spawn a thread to cancel each job or job step marked for cancellation */
/* Spawn a thread to cancel each job or job step marked for
* cancellation */
for (i = 0; i < job_buffer_ptr->record_count; i++) {
if (job_ptr[i].job_id == 0)
continue;
......
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