You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/03/26 03:50:00 UTC

[jira] [Commented] (KYLIN-3908) KylinClient's HttpRequest.releaseConnection is not needed in retrieveMetaData & executeKylinQuery

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

ASF GitHub Bot commented on KYLIN-3908:
---------------------------------------

leonliao commented on pull request #551: KYLIN-3908 KylinClient's HttpRequest.releaseConnection is not needed in retrieveMetaData & executeKylinQuery
URL: https://github.com/apache/kylin/pull/551
 
 
   This update intends to make the code to handle HTTP connection releasing not confusing. 
   Issue description is at https://issues.apache.org/jira/browse/KYLIN-3908
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> KylinClient's HttpRequest.releaseConnection is not needed in retrieveMetaData &  executeKylinQuery
> --------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-3908
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3908
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Driver - JDBC
>    Affects Versions: v2.5.2
>            Reporter: Xiaobo Liao
>            Priority: Trivial
>             Fix For: Future
>
>
> In Kylin client's code [https://github.com/apache/kylin/blob/master/jdbc/src/main/java/org/apache/kylin/jdbc/KylinClient.java]
> retrieveMetaData &  executeKylinQuery will call HttpRequestBase.releaseConnection() if the HTTP calls are succeeded, but not doing so if calls are failed.
> According to HttpClient's stack trace, connections are released back to connection manager after content is consumed.  So it is not necessary to call releaseConnection in retrieveMetaData &  executeKylinQuery. 
> Of course calling releaseConnection is not harmful, but the code now looks confusing that only calling releaseConnection if responded with 20x. 
>  
> BasicClientConnectionManager.releaseConnection(ManagedClientConnection, long, TimeUnit) line: 194    
>     ManagedClientConnectionImpl.releaseConnection() line: 447    
>     BasicManagedEntity.releaseManagedConnection() line: 201    
>     BasicManagedEntity.streamClosed(InputStream) line: 176    
>     EofSensorInputStream.checkClose() line: 237    
>     EofSensorInputStream.close() line: 186    
>     UTF8StreamJsonParser._closeInput() line: 242    
>     UTF8StreamJsonParser(ParserBase).close() line: 385    
>     ObjectMapper._readMapAndClose(JsonParser, JavaType) line: 3745    
>     ObjectMapper.readValue(InputStream, Class<T>) line: 2796    
>     KylinClient.executeKylinQuery(String, List<StatementParameter>, Map<String,String>) line: 379    
>     KylinClient.executeQuery(String, List<AvaticaParameter>, List<Object>, Map<String,String>) line: 326    
>     KylinResultSet.execute() line: 69    
>     AvaticaConnection$1.execute() line: 607    
>     KylinMeta.prepareAndExecute(Meta$StatementHandle, String, long, int, Meta$PrepareCallback) line: 111    
>     KylinConnection(AvaticaConnection).prepareAndExecuteInternal(AvaticaStatement, String, long) line: 615    
>     KylinStatement(AvaticaStatement).executeInternal(String) line: 148    
>     KylinStatement(AvaticaStatement).executeQuery(String) line: 218    



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)