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.
This commit is contained in:
parent
2d77a361f2
commit
f36b6492ab
@ -2046,15 +2046,19 @@ static void dcb_hangup_foreach_worker(MXB_WORKER* worker, struct server* server)
|
||||
{
|
||||
RoutingWorker* rworker = static_cast<RoutingWorker*>(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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user