deniskuzZ commented on code in PR #4180:
URL: https://github.com/apache/hive/pull/4180#discussion_r1176135981
##########
service/src/java/org/apache/hive/service/cli/session/HiveSessionImpl.java:
##########
@@ -432,6 +432,18 @@ private synchronized void releaseBeforeOpLock(boolean
userAccess) {
sessionState.resetThreadName();
}
+ // We have already set the thread-local Hive belonging to the current
session,
+ // if the thread-local Hive has been changed/updated after running the
operation,
+ // the Hive after should belong to the same session, and we should update
the sessionHive.
+ // The thread-local hive would be recreated only when the underlying
+ // HiveMetaStoreClient is incompatible with the newest session conf.
+ Hive localHive = Hive.getThreadLocal();
+ if (localHive != null && localHive != sessionHive) {
+ // The previous sessionHive would be GC'ed finally, or should we force
close it?
+ sessionHive = localHive;
+ sessionHive.setAllowClose(false);
Review Comment:
isn't this flag already set during open() in SessionState.getHiveDb()?
also shouldn't we call `resetThreadName()` on updated sessionHive?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]