Discard connections as the last step

Th discarding of connections in maintenance mode must be done after any
results have been written to them. This prevents closing of the connection
before the actual result is returned.
This commit is contained in:
Markus Mäkelä 2019-03-14 09:25:25 +02:00
parent e5edb5c78f
commit 09dc92973e
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -740,15 +740,6 @@ void RWSplitSession::clientReply(GWBUF* writebuf, DCB* backend_dcb)
m_can_replay_trx = true;
}
if (m_expected_responses == 0)
{
/**
* Close stale connections to servers in maintenance. Done here to avoid closing the connections
* before all responses have been received.
*/
close_stale_connections();
}
if (backend->in_use() && backend->has_session_commands())
{
// Backend is still in use and has more session commands to execute
@ -775,6 +766,15 @@ void RWSplitSession::clientReply(GWBUF* writebuf, DCB* backend_dcb)
/** Write reply to client DCB */
MXS_SESSION_ROUTE_REPLY(backend_dcb->session, writebuf);
}
if (m_expected_responses == 0)
{
/**
* Close stale connections to servers in maintenance. Done here to avoid closing the connections
* before all responses have been received.
*/
close_stale_connections();
}
}
void check_and_log_backend_state(const SRWBackend& backend, DCB* problem_dcb)