Log low-level reason and idle time on master failure
If the connection to the master is lost, knowing what type of an error caused the call to handleError helps deduce what was the real reason for it. Logging the idle time of the connection helps detect when the wait_timeout of a connection is exceeded.
This commit is contained in:
@ -943,7 +943,10 @@ void RWSplitSession::handleError(GWBUF* errmsgbuf,
|
||||
}
|
||||
else
|
||||
{
|
||||
MXS_ERROR("Lost connection to the master server, closing session.%s", errmsg.c_str());
|
||||
int64_t idle = mxs_clock() - backend->dcb()->last_read;
|
||||
MXS_ERROR("Lost connection to the master server, closing session.%s "
|
||||
"Connection has been idle for %.1f seconds. Error caused by: %s",
|
||||
errmsg.c_str(), (float)idle / 10.f, extract_error(errmsgbuf).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user