mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Turn off sending events for the LOCAL interface to the system log.
This commit is contained in:
parent
bdf640326b
commit
49d8360fc5
@ -246,6 +246,7 @@ void Session::shutdownNamedSessions()
|
||||
Session::Session(const ContextPtr & global_context_, ClientInfo::Interface interface_)
|
||||
: auth_id(UUIDHelpers::generateV4()),
|
||||
global_context(global_context_),
|
||||
interface(interface_),
|
||||
log(&Poco::Logger::get(String{magic_enum::enum_name(interface_)} + "-Session"))
|
||||
{
|
||||
prepared_client_info.emplace();
|
||||
@ -418,6 +419,11 @@ ContextMutablePtr Session::makeQueryContext(ClientInfo && query_client_info) con
|
||||
|
||||
std::shared_ptr<SessionLog> Session::getSessionLog() const
|
||||
{
|
||||
/// For the LOCAL interface we don't send events to the session log
|
||||
/// because the LOCAL interface is internal, it does nothing with networking.
|
||||
if (interface == ClientInfo::Interface::LOCAL)
|
||||
return nullptr;
|
||||
|
||||
// take it from global context, since it outlives the Session and always available.
|
||||
// please note that server may have session_log disabled, hence this may return nullptr.
|
||||
return global_context->getSessionLog();
|
||||
|
@ -79,6 +79,7 @@ private:
|
||||
mutable bool notified_session_log_about_login = false;
|
||||
const UUID auth_id;
|
||||
const ContextPtr global_context;
|
||||
const ClientInfo::Interface interface;
|
||||
|
||||
/// ClientInfo that will be copied to a session context when it's created.
|
||||
std::optional<ClientInfo> prepared_client_info;
|
||||
|
Loading…
Reference in New Issue
Block a user