mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 23:52:03 +00:00
Merge pull request #53573 from amosbird/fix_53454
Proper destruction of task in ShellCommandSource
This commit is contained in:
commit
c42c4046fe
@ -349,7 +349,7 @@ namespace
|
||||
{
|
||||
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
|
||||
{
|
||||
@ -359,6 +359,10 @@ namespace
|
||||
{
|
||||
std::lock_guard lock(send_data_lock);
|
||||
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