masaori335 commented on code in PR #13102:
URL: https://github.com/apache/trafficserver/pull/13102#discussion_r3378224785
##########
src/proxy/http/HttpTransact.cc:
##########
@@ -562,6 +562,41 @@ HttpTransact::is_server_negative_cached(State *s)
}
}
+/**
+ ATS has two configuration options controlling how many times it retries a
connection attempt against origin servers.
+
+ - proxy.config.http.connect_attempts_max_retries
+ - proxy.config.http.connect_attempts_max_retries_suspect_server
+
+ The choice is based on the state of the active HostDBInfo.
+
+ - HostDBInfo::State::UP: use proxy.config.http.connect_attempts_max_retries
+ - HostDBInfo::State::DOWN: no retry
+ - HostDBInfo::State::SUSPECT: use
proxy.config.http.connect_attempts_max_retries_suspect_server
+
+*/
+uint8_t
+HttpTransact::origin_server_connect_attempts_max_retries(State *s)
+{
+ HostDBInfo *active = s->dns_info.active;
+ if (active == nullptr) {
+ return 0;
+ }
+
+ switch (active->state(ts_clock::now(), s->txn_conf->down_server_timeout)) {
+ case HostDBInfo::State::UP:
+ return s->txn_conf->connect_attempts_max_retries;
+ case HostDBInfo::State::DOWN:
+ return 0;
+ case HostDBInfo::State::SUSPECT:
+ return s->txn_conf->connect_attempts_max_retries_suspect_server;
+ default:
+ break;
+ }
+
+ return 0;
+}
Review Comment:
`254` is picked up as limit to allow `+1`.
--
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]