Skip to content

mxqkill: Correct job counts for cancelled groups #155

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions mxqkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,9 @@ static int update_job_status_cancelled_by_group(struct mx_mysql *mysql, struct m
assert(g->group_id);

stmt = mx_mysql_statement_prepare(mysql,
"UPDATE mxq_job SET"
" job_status = " status_str(MXQ_JOB_STATUS_CANCELLED)
" WHERE group_id = ?"
" 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"
"UPDATE mxq_job SET job_cancelled = TRUE"
" WHERE group_id = ?"
" AND job_status = " status_str(MXQ_JOB_STATUS_INQ)
);
if (!stmt) {
mx_log_err("mx_mysql_statement_prepare(): %s", mx_mysql_error());
Expand Down