Fixed debug assertion and protected read of client DCB's state and consistency.
This commit is contained in:
parent
df0b04a5c0
commit
b0c152b55c
@ -852,14 +852,17 @@ static void handleError(
|
|||||||
spinlock_acquire(&session->ses_lock);
|
spinlock_acquire(&session->ses_lock);
|
||||||
sesstate = session->state;
|
sesstate = session->state;
|
||||||
client_dcb = session->client;
|
client_dcb = session->client;
|
||||||
spinlock_release(&session->ses_lock);
|
|
||||||
ss_dassert(client_dcb != NULL);
|
|
||||||
|
|
||||||
if (sesstate == SESSION_STATE_ROUTER_READY)
|
if (sesstate == SESSION_STATE_ROUTER_READY)
|
||||||
{
|
{
|
||||||
CHK_DCB(client_dcb);
|
CHK_DCB(client_dcb);
|
||||||
|
spinlock_release(&session->ses_lock);
|
||||||
client_dcb->func.write(client_dcb, gwbuf_clone(errbuf));
|
client_dcb->func.write(client_dcb, gwbuf_clone(errbuf));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
spinlock_release(&session->ses_lock);
|
||||||
|
}
|
||||||
|
|
||||||
/** false because connection is not available anymore */
|
/** false because connection is not available anymore */
|
||||||
*succp = false;
|
*succp = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user