Skip to content

Commit

Permalink
qmanager: fix error handling during hello
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
garlick committed Apr 16, 2024
1 parent 2e2ae23 commit bfc1617
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions qmanager/modules/qmanager_callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
const char *R, void *arg)

{
int rc = 0;
int rc = -1;
std::string R_out;
char *qn_attr = NULL;
std::string queue_name;
Expand Down Expand Up @@ -197,15 +197,14 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
id, uid, calc_priority (prio),
ts, R);

if ( (rc = queue->reconstruct (static_cast<void *> (h),
running_job, R_out)) < 0) {
if (queue->reconstruct (static_cast<void *> (h), running_job, R_out) < 0) {
flux_log_error (h, "%s: reconstruct (id=%jd queue=%s)", __FUNCTION__,
static_cast<intmax_t> (id), queue_name.c_str ());
goto out;
}
flux_log (h, LOG_DEBUG, "requeue success (queue=%s id=%jd)",
queue_name.c_str (), static_cast<intmax_t> (id));

rc = 0;
out:
flux_future_destroy (f);
return rc;
Expand Down

0 comments on commit bfc1617

Please sign in to comment.