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:
@ -886,13 +886,20 @@ static void handleError(
|
|||||||
spinlock_release(&session->ses_lock);
|
spinlock_release(&session->ses_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (router_cli_ses->backend_dcb) {
|
||||||
if (backend_dcb != router_cli_ses->backend_dcb)
|
if (backend_dcb != router_cli_ses->backend_dcb)
|
||||||
{
|
{
|
||||||
/* Linkages have gone badly wrong - this may not be best solution */
|
/* Linkages have gone badly wrong */
|
||||||
raise(SIGABRT);
|
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;
|
router_cli_ses->backend_dcb = NULL;
|
||||||
dcb_close(backend_dcb);
|
dcb_close(backend_dcb);
|
||||||
|
}
|
||||||
|
|
||||||
/** false because connection is not available anymore */
|
/** false because connection is not available anymore */
|
||||||
*succp = false;
|
*succp = false;
|
||||||
|
|||||||
@ -3655,10 +3655,10 @@ static bool select_connect_backend_servers(
|
|||||||
ss_dassert(backend_ref[i].bref_backend->backend_conn_count > 0);
|
ss_dassert(backend_ref[i].bref_backend->backend_conn_count > 0);
|
||||||
|
|
||||||
/** disconnect opened connections */
|
/** disconnect opened connections */
|
||||||
dcb_close(backend_ref[i].bref_dcb);
|
|
||||||
bref_clear_state(&backend_ref[i], BREF_IN_USE);
|
bref_clear_state(&backend_ref[i], BREF_IN_USE);
|
||||||
/** Decrease backend's connection counter. */
|
/** Decrease backend's connection counter. */
|
||||||
atomic_add(&backend_ref[i].bref_backend->backend_conn_count, -1);
|
atomic_add(&backend_ref[i].bref_backend->backend_conn_count, -1);
|
||||||
|
dcb_close(backend_ref[i].bref_dcb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user