mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Destroy fiber in case of exception in cancelBefore in AsyncTaskExecutor (#55516)
* Destroy fiber in case of exception in cancelBefore in AsyncTaskExecutor * Update AsyncTaskExecutor.cpp --------- Co-authored-by: Alexey Milovidov <milovidov@clickhouse.com>
This commit is contained in:
parent
749412bfeb
commit
453de30ad6
@ -1,4 +1,6 @@
|
||||
#include <Common/AsyncTaskExecutor.h>
|
||||
#include <base/scope_guard.h>
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -46,8 +48,10 @@ void AsyncTaskExecutor::cancel()
|
||||
{
|
||||
std::lock_guard guard(fiber_lock);
|
||||
is_cancelled = true;
|
||||
cancelBefore();
|
||||
destroyFiber();
|
||||
{
|
||||
SCOPE_EXIT({ destroyFiber(); });
|
||||
cancelBefore();
|
||||
}
|
||||
cancelAfter();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user