mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
return the early release and instead restore prepared_client_info and reset session_context
This commit is contained in:
parent
f8a0cfbc1a
commit
6d20082134
@ -293,6 +293,10 @@ Session::Session(const ContextPtr & global_context_, ClientInfo::Interface inter
|
||||
|
||||
Session::~Session()
|
||||
{
|
||||
/// Early release a NamedSessionData.
|
||||
if (named_session)
|
||||
named_session->release();
|
||||
|
||||
if (notified_session_log_about_login)
|
||||
{
|
||||
LOG_DEBUG(log, "{} Logout, user_id: {}", toString(auth_id), toString(*user_id));
|
||||
@ -700,6 +704,10 @@ void Session::releaseSessionID()
|
||||
{
|
||||
if (!named_session)
|
||||
return;
|
||||
|
||||
prepared_client_info = getClientInfo();
|
||||
session_context.reset();
|
||||
|
||||
named_session->release();
|
||||
named_session = nullptr;
|
||||
}
|
||||
|
@ -569,6 +569,8 @@ void HTTPHandler::processQuery(
|
||||
/// The user could specify session identifier and session timeout.
|
||||
/// It allows to modify settings, create temporary tables and reuse them in subsequent requests.
|
||||
|
||||
SCOPE_EXIT({ session->releaseSessionID(); });
|
||||
|
||||
String session_id;
|
||||
std::chrono::steady_clock::duration session_timeout;
|
||||
bool session_is_set = params.has("session_id");
|
||||
@ -904,6 +906,8 @@ void HTTPHandler::processQuery(
|
||||
{},
|
||||
handle_exception_in_output_format);
|
||||
|
||||
session->releaseSessionID();
|
||||
|
||||
if (used_output.hasDelayed())
|
||||
{
|
||||
/// TODO: set Content-Length if possible
|
||||
|
Loading…
Reference in New Issue
Block a user