mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Disable S3 requests processing during context shutdown to speed up termination process.
This commit is contained in:
parent
c96a2b4f22
commit
c933f72adb
@ -183,6 +183,9 @@ public:
|
||||
/// Return disk type - "local", "s3", etc.
|
||||
virtual const String getType() const = 0;
|
||||
|
||||
/// Invoked when Global Context is shutdown.
|
||||
virtual void shutdown() { }
|
||||
|
||||
private:
|
||||
/// Returns executor to perform asynchronous operations.
|
||||
Executor & getExecutor() { return *executor; }
|
||||
|
@ -746,4 +746,9 @@ void DiskS3::setReadOnly(const String & path)
|
||||
Poco::File(metadata_path + path).setReadOnly(true);
|
||||
}
|
||||
|
||||
void DiskS3::shutdown()
|
||||
{
|
||||
client->DisableRequestProcessing();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -102,6 +102,8 @@ public:
|
||||
|
||||
const String getType() const override { return "s3"; }
|
||||
|
||||
void shutdown() override;
|
||||
|
||||
private:
|
||||
bool tryReserve(UInt64 bytes);
|
||||
|
||||
|
@ -1973,6 +1973,13 @@ void Context::reloadConfig() const
|
||||
|
||||
void Context::shutdown()
|
||||
{
|
||||
auto disks = getDisksMap();
|
||||
for (auto & [disk_name, disk] : disks)
|
||||
{
|
||||
LOG_INFO(shared->log, "Shutdown disk {}", disk_name);
|
||||
disk->shutdown();
|
||||
}
|
||||
|
||||
shared->shutdown();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user