[ 
https://issues.apache.org/jira/browse/HIVE-13149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15178548#comment-15178548
 ] 

Aihua Xu commented on HIVE-13149:
---------------------------------

1. Sure. I will change it back.

2. Even if the tasks are on the same thread, if the conf changes, we will get a 
new HMS connection since we need to create it based on the new conf. 

I'm investigating the test failures which seems to be related. Somehow getting 
a MSC every time when we start the session hides the issue. Seems we should 
make a copy of conf and pass to Hive object since if pass a reference of conf, 
then later if we update the session conf, actually we are also updating the one 
within Hive object. Then when we call get(conf), we are getting the old MSC 
since conf is determined unchanged. 

Probably the right fix is as you said, not to do many things in get() call. 
Right now, I will just investigate the test failures and follow up to have 
get() call cleaned. 



> Remove some unnecessary HMS connections from HS2 
> -------------------------------------------------
>
>                 Key: HIVE-13149
>                 URL: https://issues.apache.org/jira/browse/HIVE-13149
>             Project: Hive
>          Issue Type: Sub-task
>          Components: HiveServer2
>    Affects Versions: 2.0.0
>            Reporter: Aihua Xu
>            Assignee: Aihua Xu
>         Attachments: HIVE-13149.1.patch, HIVE-13149.2.patch
>
>
> In SessionState class, currently we will always try to get a HMS connection 
> in {{start(SessionState startSs, boolean isAsync, LogHelper console)}} 
> regardless of if the connection will be used later or not. 
> When SessionState is accessed by the tasks in TaskRunner.java, although most 
> of the tasks other than some like StatsTask, don't need to access HMS. 
> Currently a new HMS connection will be established for each Task thread. If 
> HiveServer2 is configured to run in parallel and the query involves many 
> tasks, then the connections are created but unused.
> {noformat}
>   @Override
>   public void run() {
>     runner = Thread.currentThread();
>     try {
>       OperationLog.setCurrentOperationLog(operationLog);
>       SessionState.start(ss);
>       runSequential();
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to