mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #4017 from yandex/netlink-sockets-pool
Don't use a pool for TaskStatsInfoGetters
This commit is contained in:
commit
6fabb5eb03
@ -3,7 +3,6 @@
|
||||
#include "CurrentThread.h"
|
||||
#include <common/logger_useful.h>
|
||||
#include <Common/ThreadStatus.h>
|
||||
#include <Common/ObjectPool.h>
|
||||
#include <Common/TaskStatsInfoGetter.h>
|
||||
#include <Interpreters/ProcessList.h>
|
||||
#include <Interpreters/Context.h>
|
||||
@ -24,8 +23,6 @@ namespace ErrorCodes
|
||||
extern const int LOGICAL_ERROR;
|
||||
}
|
||||
|
||||
SimpleObjectPool<TaskStatsInfoGetter> task_stats_info_getter_pool;
|
||||
|
||||
// Smoker's implementation to avoid thread_local usage: error: undefined symbol: __cxa_thread_atexit
|
||||
#if defined(ARCADIA_ROOT)
|
||||
struct ThreadStatusPtrHolder : ThreadStatusPtr
|
||||
|
@ -21,9 +21,6 @@ namespace ErrorCodes
|
||||
}
|
||||
|
||||
|
||||
extern SimpleObjectPool<TaskStatsInfoGetter> task_stats_info_getter_pool;
|
||||
|
||||
|
||||
TasksStatsCounters TasksStatsCounters::current()
|
||||
{
|
||||
TasksStatsCounters res;
|
||||
@ -74,7 +71,7 @@ void ThreadStatus::initPerformanceCounters()
|
||||
if (TaskStatsInfoGetter::checkPermissions())
|
||||
{
|
||||
if (!taskstats_getter)
|
||||
taskstats_getter = task_stats_info_getter_pool.getDefault();
|
||||
taskstats_getter = std::make_unique<TaskStatsInfoGetter>();
|
||||
|
||||
*last_taskstats = TasksStatsCounters::current();
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include <Common/ProfileEvents.h>
|
||||
#include <Common/MemoryTracker.h>
|
||||
#include <Common/ObjectPool.h>
|
||||
|
||||
#include <IO/Progress.h>
|
||||
|
||||
@ -175,8 +174,7 @@ protected:
|
||||
std::unique_ptr<TasksStatsCounters> last_taskstats;
|
||||
|
||||
/// Set to non-nullptr only if we have enough capabilities.
|
||||
/// We use pool because creation and destruction of TaskStatsInfoGetter objects are expensive.
|
||||
SimpleObjectPool<TaskStatsInfoGetter>::Pointer taskstats_getter;
|
||||
std::unique_ptr<TaskStatsInfoGetter> taskstats_getter;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user