mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Merge pull request #34734 from ClickHouse/finally-enable-s3-async-writes
Enable async writes to S3.
This commit is contained in:
commit
05571d6362
@ -262,21 +262,20 @@ std::unique_ptr<WriteBufferFromFileBase> DiskS3::writeFile(const String & path,
|
||||
LOG_TRACE(log, "{} to file by path: {}. S3 path: {}",
|
||||
mode == WriteMode::Rewrite ? "Write" : "Append", backQuote(metadata_disk->getPath() + path), remote_fs_root_path + blob_name);
|
||||
|
||||
/// FIXME -- thread pool lead to obscure segfaults
|
||||
/// ScheduleFunc schedule = [pool = &getThreadPoolWriter(), thread_group = CurrentThread::getGroup()](auto callback)
|
||||
/// {
|
||||
/// pool->scheduleOrThrow([callback = std::move(callback), thread_group]()
|
||||
/// {
|
||||
/// if (thread_group)
|
||||
/// CurrentThread::attachTo(thread_group);
|
||||
ScheduleFunc schedule = [pool = &getThreadPoolWriter(), thread_group = CurrentThread::getGroup()](auto callback)
|
||||
{
|
||||
pool->scheduleOrThrow([callback = std::move(callback), thread_group]()
|
||||
{
|
||||
if (thread_group)
|
||||
CurrentThread::attachTo(thread_group);
|
||||
|
||||
/// SCOPE_EXIT_SAFE(
|
||||
/// if (thread_group)
|
||||
/// CurrentThread::detachQueryIfNotDetached();
|
||||
/// );
|
||||
/// callback();
|
||||
/// });
|
||||
/// };
|
||||
SCOPE_EXIT_SAFE(
|
||||
if (thread_group)
|
||||
CurrentThread::detachQueryIfNotDetached();
|
||||
);
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
auto s3_buffer = std::make_unique<WriteBufferFromS3>(
|
||||
settings->client,
|
||||
|
Loading…
Reference in New Issue
Block a user