Skip to content

Commit 5fc9272

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 9a1a316 commit 5fc9272

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
@@ -185,6 +185,15 @@ int qmanager_cb_t::jobmanager_hello_cb (flux_t *h, const flux_msg_t *msg,
185185
queue_name = qn_attr;
186186
else
187187
queue_name = ctx->opts.get_opt ().get_default_queue_name ();
188+
if (ctx->queues.find (queue_name) == ctx->queues.end ()) {
189+
flux_log (h,
190+
LOG_ERR,
191+
"%s: unknown queue name (id=%jd queue=%s)",
192+
__FUNCTION__,
193+
static_cast<intmax_t> (id),
194+
queue_name.c_str ());
195+
goto out;
196+
}
188197
queue = ctx->queues.at (queue_name);
189198
running_job = std::make_shared<job_t> (job_state_kind_t::RUNNING,
190199
id, uid, calc_priority (prio),

0 commit comments

Comments
 (0)