From a27808be9846175222751a10771c8de6a6462b50 Mon Sep 17 00:00:00 2001 From: alexey-milovidov Date: Thu, 19 Aug 2021 11:17:47 +0300 Subject: [PATCH] Revert "Do not miss exceptions from the ThreadPool" --- src/Common/ThreadPool.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/Common/ThreadPool.cpp b/src/Common/ThreadPool.cpp index 8ef85d82a1d..e6ccf405e9f 100644 --- a/src/Common/ThreadPool.cpp +++ b/src/Common/ThreadPool.cpp @@ -192,9 +192,6 @@ template ThreadPoolImpl::~ThreadPoolImpl() { finalize(); - /// wait() hadn't been called, log exception at least. - if (first_exception) - DB::tryLogException(first_exception, __PRETTY_FUNCTION__); } template @@ -273,21 +270,11 @@ void ThreadPoolImpl::worker(typename std::list::iterator thread_ } catch (...) { - ALLOW_ALLOCATIONS_IN_SCOPE; - /// job should be reset before decrementing scheduled_jobs to /// ensure that the Job destroyed before wait() returns. job = {}; { - /// In case thread pool will not be terminated on exception - /// (this is the case for GlobalThreadPool), - /// than first_exception may be overwritten and got lost, - /// and this usually is an error, since this will finish the thread, - /// and for this the caller may not be ready. - if (!shutdown_on_exception) - DB::tryLogException(std::current_exception(), __PRETTY_FUNCTION__); - std::unique_lock lock(mutex); if (!first_exception) first_exception = std::current_exception(); // NOLINT