Skip to content

Commit 9a1a316

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 80eec2a commit 9a1a316

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

138138
{
139-
int rc = 0;
139+
int rc = -1;
140140
std::string R_out;
141141
char *qn_attr = NULL;
142142
std::string queue_name;
@@ -190,15 +190,14 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
190190
id, uid, calc_priority (prio),
191191
ts, R);
192192

193-
if ( (rc = queue->reconstruct (static_cast<void *> (h),
194-
running_job, R_out)) < 0) {
193+
if (queue->reconstruct (static_cast<void *> (h), running_job, R_out) < 0) {
195194
flux_log_error (h, "%s: reconstruct (id=%jd queue=%s)", __FUNCTION__,
196195
static_cast<intmax_t> (id), queue_name.c_str ());
197196
goto out;
198197
}
199198
flux_log (h, LOG_DEBUG, "requeue success (queue=%s id=%jd)",
200199
queue_name.c_str (), static_cast<intmax_t> (id));
201-
200+
rc = 0;
202201
out:
203202
flux_future_destroy (f);
204203
return rc;

0 commit comments

Comments
 (0)