Copilot commented on code in PR #2200:
URL: https://github.com/apache/phoenix/pull/2200#discussion_r2162673607


##########
phoenix-core-client/src/main/java/org/apache/phoenix/jdbc/HighAvailabilityGroup.java:
##########
@@ -438,10 +438,21 @@ public static CuratorFramework getCurator(String jdbcUrl, 
Properties properties)
         try {
             return CURATOR_CACHE.get(jdbcUrl, () -> {
                 CuratorFramework curator = createCurator(jdbcUrl, properties);
-                if 
(!curator.blockUntilConnected(PHOENIX_HA_ZK_CONNECTION_TIMEOUT_MS_DEFAULT,
-                        TimeUnit.MILLISECONDS))
-                    throw new RuntimeException("Failed to connect to the 
CuratorFramework in "
-                            + "timeout " + 
PHOENIX_HA_ZK_CONNECTION_TIMEOUT_MS_DEFAULT + " ms");
+                try {

Review Comment:
   [nitpick] Consider using a try-finally block or a scoped resource management 
construct to centralize cleanup instead of manual catch-and-close, improving 
readability.



-- 
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-unsubscr...@phoenix.apache.org

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

Reply via email to