diggle1 commented on code in PR #99:
URL: 
https://github.com/apache/doris-kafka-connector/pull/99#discussion_r3232088675


##########
src/main/java/org/apache/doris/kafka/connector/utils/BackendUtils.java:
##########
@@ -56,17 +111,25 @@ public String getAvailableBackend() {
     }
 
     public static boolean tryHttpConnection(String backend) {
+        HttpURLConnection co = null;
         try {
-            backend = "http://"; + backend;
-            URL url = new URL(backend);
-            HttpURLConnection co = (HttpURLConnection) url.openConnection();
-            co.setConnectTimeout(60000);
+            URL url = new URL("http://"; + backend);
+            co = (HttpURLConnection) url.openConnection();
+            co.setConnectTimeout(PROBE_TIMEOUT_MS);
+            co.setReadTimeout(PROBE_TIMEOUT_MS);
             co.connect();
-            co.disconnect();
             return true;
         } catch (Exception ex) {
             LOG.warn("Failed to connect to backend:{}", backend, ex);
             return false;
+        } finally {

Review Comment:
   I'll keep the original simpler implementation.



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

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to