You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@phoenix.apache.org by GitBox <gi...@apache.org> on 2021/10/06 23:40:26 UTC

[GitHub] [phoenix] ankitjain64 commented on a change in pull request #1328: PHOENIX-6548: Throw IOException instead of IllegalArgumentException when RS crashes during index rebuilds.

ankitjain64 commented on a change in pull request #1328:
URL: https://github.com/apache/phoenix/pull/1328#discussion_r723751701



##########
File path: phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java
##########
@@ -308,13 +308,22 @@ public static HTableFactory getDelegateHTableFactory(CoprocessorEnvironment env,
             this.connectionType = connectionType;
         }
 
-        private ClusterConnection getConnection() throws IOException {
+        public ClusterConnection getConnection() throws IOException {
             return ConnectionFactory.getConnection(connectionType, conf, server);
         }
 
         @Override
         public HTableInterface getTable(ImmutableBytesPtr tablename) throws IOException {
-            return getConnection().getTable(tablename.copyBytesIfNecessary());
+            ClusterConnection connection = null;
+            try {
+                connection = getConnection();
+                return connection.getTable(tablename.copyBytesIfNecessary());

Review comment:
       It should not be since in ConnectionFactory we have that check-in place. [link](https://github.com/apache/phoenix/blob/4.x/phoenix-core/src/main/java/org/apache/phoenix/util/ServerUtil.java#L362).
   
   Also on hbase side we throw IAE in case connection is null [here](https://github.com/apache/hbase/blob/branch-1.4/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java#L307)
   




-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@phoenix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org