[ https://issues.apache.org/jira/browse/HIVE-27201?focusedWorklogId=858815&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-858815 ]
ASF GitHub Bot logged work on HIVE-27201: ----------------------------------------- Author: ASF GitHub Bot Created on: 25/Apr/23 01:06 Start Date: 25/Apr/23 01:06 Worklog Time Spent: 10m Work Description: dengzhhu653 commented on code in PR #4180: URL: https://github.com/apache/hive/pull/4180#discussion_r1175908033 ########## service/src/java/org/apache/hive/service/cli/operation/SQLOperation.java: ########## @@ -319,11 +319,7 @@ public void run() { @Override public Object run() throws HiveSQLException { assert (!parentHive.allowClose()); - try { - Hive.set(parentSessionState.getHiveDb()); - } catch (HiveException e) { - throw new HiveSQLException(e); - } + Hive.set(parentHive); Review Comment: Thank you for the comment! It doesn't revert [HIVE-25085](https://issues.apache.org/jira/browse/HIVE-25085), the `parentHive` is the same as the session's `sessionHive`, which ensures that `parentHive` wouldn't be shared across the session. Issue Time Tracking ------------------- Worklog Id: (was: 858815) Time Spent: 6.5h (was: 6h 20m) > Inconsistency between session Hive and thread-local Hive may cause HS2 > deadlock > ------------------------------------------------------------------------------- > > Key: HIVE-27201 > URL: https://issues.apache.org/jira/browse/HIVE-27201 > Project: Hive > Issue Type: Bug > Components: HiveServer2 > Reporter: Zhihua Deng > Assignee: Zhihua Deng > Priority: Major > Labels: pull-request-available > Time Spent: 6.5h > Remaining Estimate: 0h > > The HiveServer2’s server handler can switch to process the operation from > other session, in such case, the Hive cached in ThreadLocal is not the same > as the Hive in SessionState, and can be referenced by another session. > If the two handlers swap their sessions to process the DatabaseMetaData > request, and the HiveMetastoreClientFactory obtains the Hive via Hive.get(), > then there is a chance that the deadlock can happen. -- This message was sent by Atlassian Jira (v8.20.10#820010)