Skip to content

Commit e03fadb

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 0a70119 commit e03fadb

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
@@ -191,6 +191,15 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
191191
queue_name = qn_attr;
192192
else
193193
queue_name = ctx->opts.get_opt ().get_default_queue_name ();
194+
if (ctx->queues.find (queue_name) == ctx->queues.end ()) {
195+
flux_log (h,
196+
LOG_ERR,
197+
"%s: unknown queue name (id=%jd queue=%s)",
198+
__FUNCTION__,
199+
static_cast<intmax_t> (id),
200+
queue_name.c_str ());
201+
goto out;
202+
}
194203
queue = ctx->queues.at (queue_name);
195204
running_job = std::make_shared<job_t> (job_state_kind_t::RUNNING,
196205
id, uid, calc_priority (prio),

0 commit comments

Comments
 (0)