MXS-2822: Use both last_write and last_read
The code relied on last_read for the idle time calculation which caused the pings that were written to not reset the idle time. This increased the chance of multiple COM_PING packets being sent to a backend before a reply was received.
This commit is contained in:
parent
8b763fb88b
commit
3fc20d4345
@ -51,7 +51,7 @@ void RWSplitSession::handle_connection_keepalive(RWBackend* target)
|
||||
if (backend->in_use() && backend != target && !backend->is_waiting_result())
|
||||
{
|
||||
MXB_AT_DEBUG(nserv++);
|
||||
int64_t diff = now - backend->dcb()->last_read;
|
||||
int64_t diff = now - std::max(backend->dcb()->last_read, backend->dcb()->last_write);
|
||||
|
||||
if (diff > keepalive)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user