Fix possible error "Cannot drain connections: cancel first"

This commit is contained in:
Kruglov Pavel 2023-07-25 19:21:41 +02:00 committed by GitHub
parent 2ecfde96b6
commit 59db219410
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -591,8 +591,8 @@ void RemoteQueryExecutor::finish()
/// Send the request to abort the execution of the request, if not already sent. /// Send the request to abort the execution of the request, if not already sent.
tryCancel("Cancelling query because enough data has been read"); tryCancel("Cancelling query because enough data has been read");
/// If connections weren't created yet or query wasn't sent, nothing to do. /// If connections weren't created yet, query wasn't sent or was already finished, nothing to do.
if (!connections || !sent_query) if (!connections || !sent_query || finished)
return; return;
/// Get the remaining packets so that there is no out of sync in the connections to the replicas. /// Get the remaining packets so that there is no out of sync in the connections to the replicas.