acelyc111 commented on code in PR #1453:
URL: 
https://github.com/apache/incubator-pegasus/pull/1453#discussion_r1174854643


##########
src/client/replication_ddl_client.cpp:
##########
@@ -1434,23 +1422,52 @@ bool replication_ddl_client::valid_app_char(int c)
     return (bool)std::isalnum(c) || c == '_' || c == '.' || c == ':';
 }
 
+namespace {
+
+bool need_retry(uint32_t attempt_count, const dsn::error_code &err)
+{
+    // For successful request, no need to retry.
+    if (err == dsn::ERR_OK) {
+        return false;
+    }
+
+    // As long as the max attempt count has not been reached, just do retry;
+    // otherwise, do not attempt again.
+    return attempt_count < FLAGS_ddl_client_max_attempt_count;
+}
+
+} // anonymous namespace
+
 void replication_ddl_client::end_meta_request(const rpc_response_task_ptr 
&callback,
-                                              int retry_times,
-                                              error_code err,
+                                              uint32_t attempt_count,

Review Comment:
   How about `attempted_count`?



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