Skip to content

Commit 61dcadb

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 169a5ca commit 61dcadb

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
@@ -143,7 +143,7 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
143143
const char *R, void *arg)
144144

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

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

0 commit comments

Comments
 (0)