mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 06:01:57 +00:00
Wait for tasks finish when scheduler failed
This commit is contained in:
parent
3e77463125
commit
cfb832b205
@ -66,17 +66,7 @@ namespace
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~UploadHelper()
|
virtual ~UploadHelper() = default;
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
waitForAllBackGroundTasks();
|
|
||||||
}
|
|
||||||
catch (...)
|
|
||||||
{
|
|
||||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::shared_ptr<const S3::Client> client_ptr;
|
std::shared_ptr<const S3::Client> client_ptr;
|
||||||
@ -219,6 +209,8 @@ namespace
|
|||||||
size_t position = start_offset;
|
size_t position = start_offset;
|
||||||
size_t end_position = start_offset + size;
|
size_t end_position = start_offset + size;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
for (size_t part_number = 1; position < end_position; ++part_number)
|
for (size_t part_number = 1; position < end_position; ++part_number)
|
||||||
{
|
{
|
||||||
if (multipart_upload_aborted)
|
if (multipart_upload_aborted)
|
||||||
@ -231,6 +223,14 @@ namespace
|
|||||||
|
|
||||||
position = next_position;
|
position = next_position;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||||
|
abortMultipartUpload();
|
||||||
|
waitForAllBackGroundTasks();
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
waitForAllBackGroundTasks();
|
waitForAllBackGroundTasks();
|
||||||
completeMultipartUpload();
|
completeMultipartUpload();
|
||||||
|
Loading…
Reference in New Issue
Block a user