dbms: Server: Correctly disconnect when exceptions occur in RemoteBlockInputStream. [#METR-15689]

This commit is contained in:
Alexey Arno 2015-04-15 16:23:37 +03:00
parent beddce0927
commit bc2de9a94d

View File

@ -97,7 +97,7 @@ public:
* все соединения, затем читаем и пропускаем оставшиеся пакеты чтобы
* эти соединения не остались висеть в рассихронизированном состоянии.
*/
if (established || isQueryInProgress())
if (established || isQueryInProgress() || isQueryCancelled())
parallel_replicas->disconnect();
}
@ -257,6 +257,12 @@ protected:
return sent_query && !finished && !was_cancelled;
}
/// Возвращает true, если запрос отправлен, а отменён до его завершения.
bool isQueryCancelled() const
{
return sent_query && !finished && was_cancelled;
}
/// Возвращает true, если никакой запрос не отправлен или один запрос уже выполнен.
bool hasNoQueryInProgress() const
{