You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lens.apache.org by "Raju Bairishetti (JIRA)" <ji...@apache.org> on 2016/03/03 01:40:18 UTC

[jira] [Commented] (LENS-853) Quitting shell(quitshell()) is not closing session some times.

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

Raju Bairishetti commented on LENS-853:
---------------------------------------

bq. Needs more investigation. Setting isConnectionAlive to true during setClient causes the API to fail during close session.
   Tests were failing because it was tying to close singleton lens client always even though we are creating multliple lens client instances in test cases. closeSession is throwing "Hive session does not exists" exception when it is trying to close session from cli test cases.





> Quitting shell(quitshell()) is not closing session some times.
> --------------------------------------------------------------
>
>                 Key: LENS-853
>                 URL: https://issues.apache.org/jira/browse/LENS-853
>             Project: Apache Lens
>          Issue Type: Bug
>          Components: client
>            Reporter: Raju Bairishetti
>            Assignee: Raju Bairishetti
>              Labels: newbie
>
> Quitting session through programmatically is not closing the session some times. 
> First it checks whether connection to server is active or not to close the session. It is depending on isConnectionActive variable to check the connection is active or not. Right now we are setting isConnectionActive to true only  if user calls  getClient(). isConnectionActive should be set to true when user calls setClient(client). 
> code snippets:
> ----------------
> {code}
>   public LensClient getClient() {
>     if (lensClient == null) {
>       setClient(getClientWrapper().getClient());
>       isConnectionActive = true;
>     }
>     return lensClient;
>   }
> {code}
> {code}
> protected static synchronized void closeClientConnection() {
>     if (isConnectionActive) {
>       log.debug("Request for stopping lens cli received");
>       getClientWrapper().getClient().closeConnection();
>       isConnectionActive = false;
>     }
>   }
> {code}



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