You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/06/16 09:35:14 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #5884: [HUDI-3669] Add a remote request retry mechanism for 'Remotehoodietablefiles…

danny0405 commented on code in PR #5884:
URL: https://github.com/apache/hudi/pull/5884#discussion_r898888250


##########
hudi-common/src/main/java/org/apache/hudi/common/table/view/RemoteHoodieTableFileSystemView.java:
##########
@@ -137,17 +138,18 @@ private enum RequestMethod {
   }
 
   public RemoteHoodieTableFileSystemView(String server, int port, HoodieTableMetaClient metaClient) {
-    this(server, port, metaClient, 300);
+    this(server, port, metaClient, 300, 3);
   }

Review Comment:
   A better way is to fetch the constant from the config option.



##########
hudi-common/src/main/java/org/apache/hudi/common/table/view/RemoteHoodieTableFileSystemView.java:
##########
@@ -165,16 +167,29 @@ private <T> T executeRequest(String requestPath, Map<String, String> queryParame
 
     String url = builder.toString();
     LOG.info("Sending request : (" + url + ")");
-    Response response;
+    Response response = null;
     int timeout = this.timeoutSecs * 1000; // msec
-    switch (method) {
-      case GET:
-        response = Request.Get(url).connectTimeout(timeout).socketTimeout(timeout).execute();
-        break;
-      case POST:
-      default:
-        response = Request.Post(url).connectTimeout(timeout).socketTimeout(timeout).execute();
+    int retryCounts = 0;
+    while (retryCounts <= maxRetries) {
+      try {
+        switch (method) {

Review Comment:
   We introduced a retry helper in https://github.com/apache/hudi/pull/3887, with richer strategies, maybe you can take a reference.



-- 
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: commits-unsubscribe@hudi.apache.org

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