Skip to content

Commit 99e13b4

Browse files
committed
fixup crash from gha
1 parent 61fab1e commit 99e13b4

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/python_embedded.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,11 @@ static uint64_t qd_io_rx_handler(void *context, qd_message_t *msg, int link_id,
639639
IoAdapter *self = (IoAdapter*) context;
640640
*error = 0;
641641

642+
if (self->handler == NULL) {
643+
*error = qdr_error(QD_AMQP_COND_INTERNAL_ERROR, "Router is shutting down");
644+
return PN_REJECTED;
645+
}
646+
642647
//
643648
// Parse the message through the body and exit if the message is not well formed.
644649
//

src/router_core/router_core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ void qdr_core_free(qdr_core_t *core)
255255
// this must happen after qdrc_endpoint_do_cleanup_CT calls
256256
qdr_modules_finalize(core);
257257

258+
// Drain the general work lists
259+
// (this can also generate actions, e.g. qdr_forward_on_message -> qd_io_rx_handler call chain does that)
260+
qdr_general_handler(core);
261+
258262
// discard any left over actions
259263

260264
qdr_action_list_t action_list;
@@ -268,9 +272,6 @@ void qdr_core_free(qdr_core_t *core)
268272
action = DEQ_HEAD(action_list);
269273
}
270274

271-
// Drain the general work lists
272-
qdr_general_handler(core);
273-
274275
sys_thread_free(core->thread);
275276
sys_cond_free(core->action_cond);
276277
sys_mutex_free(core->action_lock);

0 commit comments

Comments
 (0)