Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,12 @@ public ConnectContext buildTaskRunConnectContext() {
context.setQueryId(UUID.fromString(status.getQueryId()));
context.setIsLastStmt(true);
context.resetSessionVariable();
switchUser(context);

// NOTE: Ensure the thread local connect context is always the same with the newest ConnectContext.
// NOTE: Ensure this thread local is removed after this method to avoid memory leak in JVM.
context.setThreadLocalInfo();
// NOTE: The switchUser might depend on the thread-local context if it's LDAP user
switchUser(context);
return context;
}

Expand Down
Loading