Skip to content

Commit

Permalink
mxqkill: Allow cancellation of assigned jobs
Browse files Browse the repository at this point in the history
ASSIGNED -> CANCELLING -> CANCELLED
ASSIGNED -> CANCELLED
  • Loading branch information
mariux committed Aug 13, 2015
1 parent dc5f1eb commit 3983a9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mxqkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static int update_job_status_cancelled_by_group(struct mx_mysql *mysql, struct m
"UPDATE mxq_job SET"
" job_status = " status_str(MXQ_JOB_STATUS_CANCELLED)
" WHERE group_id = ?"
" AND job_status = " status_str(MXQ_JOB_STATUS_INQ)
" AND job_status = IN (" status_str(MXQ_JOB_STATUS_INQ) "," status_str(MXQ_JOB_STATUS_ASSIGNED) ")"
" AND host_hostname = ''"
" AND server_id = ''"
" AND host_pid = 0"
Expand Down Expand Up @@ -180,7 +180,7 @@ static int update_job_status_cancelling_by_job_id_for_user(struct mx_mysql *mysq
" job_status = " status_str(MXQ_JOB_STATUS_CANCELLING)
" WHERE job_id = ?"
" AND user_uid = ?"
" AND job_status = " status_str(MXQ_JOB_STATUS_INQ)
" AND job_status IN (" status_str(MXQ_JOB_STATUS_INQ) "," status_str(MXQ_JOB_STATUS_ASSIGNED) ")"
" AND host_hostname = ''"
" AND server_id = ''"
" AND host_pid = 0"
Expand Down
2 changes: 1 addition & 1 deletion mysql/create_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ CREATE TRIGGER mxq_update_job BEFORE UPDATE ON mxq_job
stats_total_real_sec=stats_total_real_sec+NEW.stats_real_sec,
group_mtime=NULL
WHERE group_id=NEW.group_id;
ELSEIF NEW.job_status = 990 AND OLD.job_status IN (0, 989) THEN
ELSEIF NEW.job_status = 990 AND OLD.job_status IN (0, 100, 989) THEN
UPDATE mxq_group SET
group_jobs_inq=group_jobs_inq-1,
group_jobs_cancelled=group_jobs_cancelled+1,
Expand Down

0 comments on commit 3983a9e

Please sign in to comment.