mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Proper destruction of task
This commit is contained in:
parent
e7d0edfce6
commit
052281896a
@ -266,7 +266,7 @@ namespace
|
|||||||
{
|
{
|
||||||
for (auto && send_data_task : send_data_tasks)
|
for (auto && send_data_task : send_data_tasks)
|
||||||
{
|
{
|
||||||
send_data_threads.emplace_back([task = std::move(send_data_task), this]()
|
send_data_threads.emplace_back([task = std::move(send_data_task), this]() mutable
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -276,6 +276,10 @@ namespace
|
|||||||
{
|
{
|
||||||
std::lock_guard lock(send_data_lock);
|
std::lock_guard lock(send_data_lock);
|
||||||
exception_during_send_data = std::current_exception();
|
exception_during_send_data = std::current_exception();
|
||||||
|
|
||||||
|
/// task should be reset inside catch block or else it breaks d'tor
|
||||||
|
/// invariants such as in ~WriteBuffer.
|
||||||
|
task = {};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user