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

ASF GitHub Bot commented on PHOENIX-6276:
-----------------------------------------

ChinmaySKulkarni commented on a change in pull request #1057:
URL: https://github.com/apache/phoenix/pull/1057#discussion_r551585427



##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -484,6 +484,16 @@ private void openConnection() throws SQLException {
         }
     }
 
+    // Close the HBase Connection
+    private void closeConnection() throws IOException {
+        if (connection != null) {
+            LOGGER.info("HConnection closed. Stacktrace for informational 
purposes: "
+                + connection + " " + LogUtil.getCallerStackTrace());
+            connection.close();

Review comment:
       Put the log line after the call. If `connection.close()` throws then the 
log line will be misleading.

##########
File path: 
phoenix-core/src/main/java/org/apache/phoenix/query/ConnectionQueryServicesImpl.java
##########
@@ -3322,7 +3331,7 @@ public Void call() throws Exception {
                         } finally {
                             try {
                                 if (!success && hConnectionEstablished) {
-                                    connection.close();
+                                    closeConnection();

Review comment:
       One nice side-effect of your change is that we will be decrementing 
`GLOBAL_HCONNECTIONS_COUNTER` at this point now, which looks like we were 
missing before.




----------------------------------------------------------------
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:
[email protected]


> Log when hconnection is getting closed in ConnectionQueryServicesImpl
> ---------------------------------------------------------------------
>
>                 Key: PHOENIX-6276
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6276
>             Project: Phoenix
>          Issue Type: Improvement
>          Components: core
>            Reporter: Sandeep Pal
>            Assignee: Sandeep Pal
>            Priority: Major
>
> It has been observed that for an active phoenix connection, the hconnection 
> gets closed due to unknown reason. We should log every hconnection closure so 
> we can track how this gets closed. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to