Fix error handling for binlogrouter

The binlogrouter error handling closed the DCB twice. This was caused by
the change in the way the DCB error handling is done.

The protocol modules now also call the error handling routine even if the
router session is NULL. This enables the binlogrouter to manage
authentication failures correctly instead of trying to reconnect again.
This commit is contained in:
Markus Mäkelä
2017-03-29 12:01:43 +03:00
parent 3f62ea2c41
commit 509a5c6ed3
2 changed files with 36 additions and 37 deletions

View File

@ -567,14 +567,11 @@ static void gw_reply_on_error(DCB *dcb, mxs_auth_state_t state)
MXS_SESSION *session = dcb->session;
CHK_SESSION(session);
if (session->router_session)
if (!dcb->dcb_errhandle_called)
{
do_handle_error(dcb, ERRACT_REPLY_CLIENT,
"Authentication with backend failed. Session will be closed.");
session->state = SESSION_STATE_STOPPING;
}
else
{
dcb->dcb_errhandle_called = true;
}
}