mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 03:42:48 +00:00
- remove memory allocations in signal handler
- revert ThreadStatus::getQueryId() - refactor
This commit is contained in:
parent
12fe175385
commit
5b50026860
@ -27,7 +27,12 @@ namespace
|
||||
{
|
||||
void writeTraceInfo(TimerType timer_type, int /* sig */, siginfo_t * /* info */, void * context)
|
||||
{
|
||||
DB::WriteBufferFromFileDescriptor out(trace_pipe.fds_rw[1]);
|
||||
char buffer[DBMS_DEFAULT_BUFFER_SIZE];
|
||||
DB::WriteBufferFromFileDescriptor out(
|
||||
/* fd */ trace_pipe.fds_rw[1],
|
||||
/* buf_size */ DBMS_DEFAULT_BUFFER_SIZE,
|
||||
/* existing_memory */ buffer
|
||||
);
|
||||
|
||||
const std::string & query_id = CurrentThread::getQueryId();
|
||||
|
||||
@ -62,7 +67,7 @@ public:
|
||||
|
||||
struct sigaction sa{};
|
||||
sa.sa_sigaction = ProfilerImpl::signalHandler;
|
||||
sa.sa_flags = SA_SIGINFO;
|
||||
sa.sa_flags = SA_SIGINFO | SA_RESTART;
|
||||
|
||||
if (sigemptyset(&sa.sa_mask))
|
||||
throw Poco::Exception("Failed to clean signal mask for query profiler");
|
||||
|
@ -202,8 +202,8 @@ struct Settings
|
||||
M(SettingBool, empty_result_for_aggregation_by_empty_set, false, "Return empty result when aggregating without keys on empty set.") \
|
||||
M(SettingBool, allow_distributed_ddl, true, "If it is set to true, then a user is allowed to executed distributed DDL queries.") \
|
||||
M(SettingUInt64, odbc_max_field_size, 1024, "Max size of filed can be read from ODBC dictionary. Long strings are truncated.") \
|
||||
M(SettingUInt64, query_profiler_real_time_period, 200000000, "Period for real clock timer of query profiler (in nanoseconds).") \
|
||||
M(SettingUInt64, query_profiler_cpu_time_period, 200000000, "Period for CPU clock timer of query profiler (in nanoseconds).") \
|
||||
M(SettingUInt64, query_profiler_real_time_period, 500000000, "Period for real clock timer of query profiler (in nanoseconds).") \
|
||||
M(SettingUInt64, query_profiler_cpu_time_period, 500000000, "Period for CPU clock timer of query profiler (in nanoseconds).") \
|
||||
\
|
||||
\
|
||||
/** Limits during query execution are part of the settings. \
|
||||
|
@ -42,7 +42,11 @@ void ThreadStatus::attachQueryContext(Context & query_context_)
|
||||
|
||||
const std::string & ThreadStatus::getQueryId() const
|
||||
{
|
||||
return query_id;
|
||||
static const std::string empty = "";
|
||||
if (query_context)
|
||||
return query_context->getClientInfo().current_query_id;
|
||||
|
||||
return empty;
|
||||
}
|
||||
|
||||
void CurrentThread::defaultThreadDeleter()
|
||||
|
Loading…
Reference in New Issue
Block a user