Skip to content

Commit 6654888

Browse files
garlickmilroy
authored andcommitted
qmanager: improve unknown queue hello error
Problem: when a hello response is received for a job with an unkown queue, the error is not super helpful. Instead of: jobmanager_hello_cb: ENOENT: map::at: No such file or directory make it: jobmanager_hello_cb: unknown queue name (id=41137733632 queue=default) This can occur when queues are reconfigured and the scheduler is reloaded, so it's nice to have the job id and the offending queue name.
1 parent 61dcadb commit 6654888

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

qmanager/modules/qmanager_callbacks.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,15 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
192192
queue_name = qn_attr;
193193
else
194194
queue_name = ctx->opts.get_opt ().get_default_queue_name ();
195+
if (ctx->queues.find (queue_name) == ctx->queues.end ()) {
196+
flux_log (h,
197+
LOG_ERR,
198+
"%s: unknown queue name (id=%jd queue=%s)",
199+
__FUNCTION__,
200+
static_cast<intmax_t> (id),
201+
queue_name.c_str ());
202+
goto out;
203+
}
195204
queue = ctx->queues.at (queue_name);
196205
running_job = std::make_shared<job_t> (job_state_kind_t::RUNNING,
197206
id, uid, calc_priority (prio),

0 commit comments

Comments
 (0)