readwritesplit.c:handleError is meant to handle backend errors. Removed one call from mysql_client.c and only send error message to client instead.

Added checks to debug build to ensure that handleError is called before backend DCB is closed.
This commit is contained in:
VilhoRaatikka
2014-11-07 17:55:05 +02:00
parent 4f39828fa1
commit 44771dbc51
3 changed files with 31 additions and 26 deletions

View File

@ -838,29 +838,18 @@ int gw_read_client_event(
{
GWBUF* errbuf;
bool succp;
errbuf = mysql_create_custom_error(
1,
0,
"Write to backend failed. Session closed.");
#if defined(SS_DEBUG)
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Client routing error handling.")));
#endif
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Routing the query failed. "
"Session will be closed.")));
router->handleError(router_instance,
rsession,
errbuf,
dcb,
ERRACT_REPLY_CLIENT,
&succp);
gwbuf_free(errbuf);
ss_dassert(!succp);
modutil_send_mysql_err_packet(dcb,
1,
0,
2003,
"HY000",
"Write to backend failed. Session closed.");
LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR,
"Error : Routing the query failed. "
"Session will be closed.")));
dcb_close(dcb);
}