Skip to content

Commit e5d659c

Browse files
garlickmilroy
authored andcommitted
qmanager: fix error handling during hello
Problem: several error paths in jobmanager_hello_cb() do not result in the function returning a failure. I think the only ones that do trigger an error are a C++ exception (due to the wrapper) and if (queue->reconstruct() returns -1. The callback returns 0 (success) in other cases which could result in double booked resources.
1 parent cf35f40 commit e5d659c

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

qmanager/modules/qmanager_callbacks.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
142142
const char *R, void *arg)
143143

144144
{
145-
int rc = 0;
145+
int rc = -1;
146146
std::string R_out;
147147
char *qn_attr = NULL;
148148
std::string queue_name;
@@ -196,15 +196,14 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
196196
id, uid, calc_priority (prio),
197197
ts, R);
198198

199-
if ( (rc = queue->reconstruct (static_cast<void *> (h),
200-
running_job, R_out)) < 0) {
199+
if (queue->reconstruct (static_cast<void *> (h), running_job, R_out) < 0) {
201200
flux_log_error (h, "%s: reconstruct (id=%jd queue=%s)", __FUNCTION__,
202201
static_cast<intmax_t> (id), queue_name.c_str ());
203202
goto out;
204203
}
205204
flux_log (h, LOG_DEBUG, "requeue success (queue=%s id=%jd)",
206205
queue_name.c_str (), static_cast<intmax_t> (id));
207-
206+
rc = 0;
208207
out:
209208
flux_future_destroy (f);
210209
return rc;

0 commit comments

Comments
 (0)