From 70b5330ac01dfbdbc1a53333a8c02e134d7ca3fc Mon Sep 17 00:00:00 2001 From: Moe Jette <jette1@llnl.gov> Date: Thu, 5 Feb 2009 16:27:27 +0000 Subject: [PATCH] Add an error code for overlapping reservations --- slurm/slurm_errno.h | 1 + src/common/slurm_errno.c | 2 ++ src/slurmctld/reservation.c | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/slurm/slurm_errno.h b/slurm/slurm_errno.h index f1dc2164ef7..ebec2ee2790 100644 --- a/slurm/slurm_errno.h +++ b/slurm/slurm_errno.h @@ -166,6 +166,7 @@ enum { ESLURM_RESERVATION_BUSY, ESLURM_RESERVATION_NOT_USABLE, ESLURM_INVALID_WCKEY, + ESLURM_RESERVATION_OVERLAP, /* switch specific error codes, specific values defined in plugin module */ ESLURM_SWITCH_MIN = 3000, diff --git a/src/common/slurm_errno.c b/src/common/slurm_errno.c index 2e94c6589c1..e49274cb037 100644 --- a/src/common/slurm_errno.c +++ b/src/common/slurm_errno.c @@ -234,6 +234,8 @@ static slurm_errtab_t slurm_errtab[] = { "Requested reservation is in use" }, { ESLURM_RESERVATION_NOT_USABLE, "Requested reservation not usable now" }, + { ESLURM_RESERVATION_OVERLAP, + "Requested reservation overlaps with another reservation" }, /* slurmd error codes */ diff --git a/src/slurmctld/reservation.c b/src/slurmctld/reservation.c index 87a9275c956..94ac02c4b48 100644 --- a/src/slurmctld/reservation.c +++ b/src/slurmctld/reservation.c @@ -900,7 +900,7 @@ extern int create_resv(reserve_request_msg_t *resv_desc_ptr) resv_desc_ptr->flags, node_bitmap, NULL)) { info("Reservation requestion overlaps another"); - rc = ESLURM_INVALID_TIME_VALUE; + rc = ESLURM_RESERVATION_OVERLAP; goto bad_parse; } resv_desc_ptr->node_cnt = bit_set_count(node_bitmap); @@ -1132,7 +1132,7 @@ extern int update_resv(reserve_request_msg_t *resv_desc_ptr) if (_resv_overlap(resv_ptr->start_time, resv_ptr->end_time, resv_ptr->flags, resv_ptr->node_bitmap, resv_ptr)) { info("Reservation requestion overlaps another"); - error_code = ESLURM_INVALID_TIME_VALUE; + error_code = ESLURM_RESERVATION_OVERLAP; goto update_failure; } _set_cpu_cnt(resv_ptr); -- GitLab