Added error check to mysql_backend.c to prevent unnecessary logging.
This commit is contained in:
@ -834,15 +834,19 @@ static int gw_error_backend_event(DCB *dcb)
|
||||
char buf[100];
|
||||
|
||||
len = sizeof(error);
|
||||
|
||||
if (getsockopt(dcb->fd, SOL_SOCKET, SO_ERROR, &error, &len) == 0)
|
||||
{
|
||||
if (error != 0)
|
||||
{
|
||||
strerror_r(error, buf, 100);
|
||||
LOGIF(LE, (skygw_log_write_flush(
|
||||
LOGFILE_ERROR,
|
||||
"DCB in state %s got error '%s'.",
|
||||
gw_dcb_state2string(dcb->state),
|
||||
STRDCBSTATE(dcb->state),
|
||||
buf)));
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
errbuf = mysql_create_custom_error(
|
||||
@ -874,6 +878,8 @@ static int gw_error_backend_event(DCB *dcb)
|
||||
|
||||
len = sizeof(error);
|
||||
if (getsockopt(dcb->fd, SOL_SOCKET, SO_ERROR, &error, &len) == 0)
|
||||
{
|
||||
if (error != 0)
|
||||
{
|
||||
strerror_r(error, buf, 100);
|
||||
LOGIF(LE, (skygw_log_write_flush(
|
||||
@ -881,6 +887,7 @@ static int gw_error_backend_event(DCB *dcb)
|
||||
"Error '%s' in session that is not ready for routing.",
|
||||
buf)));
|
||||
}
|
||||
}
|
||||
gwbuf_free(errbuf);
|
||||
goto retblock;
|
||||
}
|
||||
|
Reference in New Issue
Block a user