[ https://issues.apache.org/jira/browse/KYLIN-3908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16803952#comment-16803952 ]
ASF subversion and git services commented on KYLIN-3908: -------------------------------------------------------- Commit 9ab6c2f12bbddd5b402a373f37afca3c8ec9aafe in kylin's branch refs/heads/master from leonliao [ https://gitbox.apache.org/repos/asf?p=kylin.git;h=9ab6c2f ] KYLIN-3908 KylinClient's HttpRequest.releaseConnection is not needed in retrieveMetaData & executeKylinQuery (#551) KYLIN-3908 httpRequest.releaseConnection enclosed with a finally block > 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 > Assignee: 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)