Change abort to error message when read connection router finds mismatch between router client session DCB and given backend DCB; improve order of actions when closing DCB in read-write router.

This commit is contained in:
counterpoint
2015-09-15 15:22:44 +01:00
parent 0cf4b2cf68
commit fdbe070e80
2 changed files with 15 additions and 8 deletions

View File

@ -885,14 +885,21 @@ static void handleError(
{
spinlock_release(&session->ses_lock);
}
if (backend_dcb != router_cli_ses->backend_dcb)
{
/* Linkages have gone badly wrong - this may not be best solution */
raise(SIGABRT);
if (router_cli_ses->backend_dcb) {
if (backend_dcb != router_cli_ses->backend_dcb)
{
/* Linkages have gone badly wrong */
LOGIF(LE, (skygw_log_write(LOGFILE_ERROR,
"Read Connection Router error in handleError: router client "
"session DCB %p is not null, but does not match backend DCB %p "
"either. \n",
router_cli_ses->backend_dcb,
backend_dcb)));
}
router_cli_ses->backend_dcb = NULL;
dcb_close(backend_dcb);
}
router_cli_ses->backend_dcb = NULL;
dcb_close(backend_dcb);
/** false because connection is not available anymore */
*succp = false;