You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "lvyankui (Jira)" <ji...@apache.org> on 2021/12/30 11:55:00 UTC

[jira] [Assigned] (HIVE-25402) When Hive client has multiple statements without close. queryIdOperation in OperationManager class will exist object that cannot be released

     [ https://issues.apache.org/jira/browse/HIVE-25402?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

lvyankui reassigned HIVE-25402:
-------------------------------

    Assignee: lvyankui

> When Hive client has multiple statements without close. queryIdOperation in OperationManager class will exist object that cannot be released
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-25402
>                 URL: https://issues.apache.org/jira/browse/HIVE-25402
>             Project: Hive
>          Issue Type: Bug
>          Components: HiveServer2
>    Affects Versions: All Versions
>            Reporter: lvyankui
>            Assignee: lvyankui
>            Priority: Major
>         Attachments: HIVE-25402.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Hive client code has multiple statements without close
> connect = DriverManager.getConnection(jdbcUrl, user, password);
> PrintWriter pw = new PrintWriter("/tmp/hive.result" );
> Statement stmt = connect.createStatement();
> Statement stmt1 = connect.createStatement();
> Statement stmt2 = connect.createStatement();
> String sql = "select * from test";
> runSQL(stmt, sql, pw);
> runSQL(stmt1, sql, pw);
> runSQL(stmt2, sql, pw);
>  
> OperationManager  removeOperation  method
> private Operation removeOperation(OperationHandle opHandle) {
>  Operation operation = handleToOperation.remove(opHandle);
>  if (operation == null) {
>  throw new RuntimeException("Operation does not exist: " + opHandle);
>  }
>  String queryId = getQueryId(operation);
>  *queryIdOperation.remove(queryId);*
>  
> The key of queryIdOperation is queryIdOperation is queryId, queryId is  getted from HiveConf. A new queryId will be generated when a new queryPlan is generated and set it into HiveConf.  If Hive client code has multiple statements without close, when sqls execute complete, queryIdOperation can only release the object whose queryId is last generated,other object cannot be released.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)