From f36b6492ab027d55a09006eae23915fcd487bfe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 3 Jul 2019 12:57:27 +0300 Subject: [PATCH] Update current DCB for hangup events When fake hangup events are delivered via DCBs, the current DCB would not be updated. This would cause error messages without a session ID which makes failure analysis harder. --- server/core/dcb.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/core/dcb.cc b/server/core/dcb.cc index 6af8790bd..a75184fe6 100644 --- a/server/core/dcb.cc +++ b/server/core/dcb.cc @@ -2046,15 +2046,19 @@ static void dcb_hangup_foreach_worker(MXB_WORKER* worker, struct server* server) { RoutingWorker* rworker = static_cast(worker); int id = rworker->id(); + DCB* old_current = this_thread.current_dcb; for (DCB* dcb = this_unit.all_dcbs[id]; dcb; dcb = dcb->thread.next) { if (dcb->state == DCB_STATE_POLLING && dcb->server && dcb->server == server && dcb->n_close == 0) { + this_thread.current_dcb = dcb; dcb->flags |= DCBF_HUNG; dcb->func.hangup(dcb); } } + + this_thread.current_dcb = old_current; } /**