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:
parent
e5edb5c78f
commit
09dc92973e
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user