MXS-3054: Prevent pooling of DCBs with inbound data

If a DCB is expecting a response from the server, it must not be placed
into the connection pool. This prevents the case where unexpected
responses would be delivered to DCBs taken out of the connection pool.
This commit is contained in:
Markus Mäkelä
2020-06-30 15:14:14 +03:00
parent 9f07613330
commit 1ad8ae97d3
3 changed files with 3 additions and 0 deletions

View File

@ -61,6 +61,7 @@ void Backend::close(close_type type)
/** Clean operation counter in bref and in SERVER */
if (is_waiting_result())
{
m_dcb->valid_for_pool = false;
clear_state(WAITING_RESULT);
}
clear_state(IN_USE);

View File

@ -1260,6 +1260,7 @@ static bool dcb_maybe_add_persistent(DCB* dcb)
&& strlen(dcb->user)
&& server
&& dcb->session
&& dcb->valid_for_pool
&& session_valid_for_pool(dcb->session)
&& server->persistpoolmax()
&& (server->status & SERVER_RUNNING)