dbms: Added code that lowers cancellation latency. [#METR-18510]

This commit is contained in:
Alexey Arno 2016-03-02 23:08:38 +03:00
parent 9bf811ddac
commit 04db615bde

View File

@ -332,15 +332,6 @@ int Server::main(const std::vector<std::string> & args)
SCOPE_EXIT(
LOG_DEBUG(log, "Closed all connections.");
if (has_resharding_worker)
{
LOG_INFO(log, "Shutting down resharding thread");
auto & resharding_worker = global_context->getReshardingWorker();
if (resharding_worker.isStarted())
resharding_worker.shutdown();
LOG_DEBUG(log, "Shut down resharding thread");
}
/** Попросим завершить фоновую работу у всех движков таблиц.
* Это важно делать заранее, не в деструкторе Context-а, так как
* движки таблиц могут при уничтожении всё ещё пользоваться Context-ом.
@ -433,7 +424,18 @@ int Server::main(const std::vector<std::string> & args)
LOG_INFO(log, "Ready for connections.");
SCOPE_EXIT(
LOG_DEBUG(log, "Received termination signal. Waiting for current connections to close.");
LOG_DEBUG(log, "Received termination signal.");
if (has_resharding_worker)
{
LOG_INFO(log, "Shutting down resharding thread");
auto & resharding_worker = global_context->getReshardingWorker();
if (resharding_worker.isStarted())
resharding_worker.shutdown();
LOG_DEBUG(log, "Shut down resharding thread");
}
LOG_DEBUG(log, "Waiting for current connections to close.");
users_config_reloader.reset();