This is an automated email from the ASF dual-hosted git repository. zwoop pushed a commit to branch 9.2.x in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit c2bbd9e91cc2f600f65ea992bcb9fa728378da73 Author: Robert O Butts <[email protected]> AuthorDate: Mon Aug 15 17:28:28 2022 -0600 Remove plugin parent_select unused symbols (#9023) (cherry picked from commit b477c8d8447d01084b6d0714cc5860042b20c0d3) --- plugins/experimental/parent_select/consistenthash.cc | 5 ++--- plugins/experimental/parent_select/consistenthash.h | 5 ++--- plugins/experimental/parent_select/parent_select.cc | 13 +++---------- plugins/experimental/parent_select/strategy.h | 10 ++++------ 4 files changed, 11 insertions(+), 22 deletions(-) diff --git a/plugins/experimental/parent_select/consistenthash.cc b/plugins/experimental/parent_select/consistenthash.cc index d26eed5a6..0317407a9 100644 --- a/plugins/experimental/parent_select/consistenthash.cc +++ b/plugins/experimental/parent_select/consistenthash.cc @@ -288,9 +288,8 @@ PLNextHopConsistentHash::deleteTxn(void *txn) } void -PLNextHopConsistentHash::next(TSHttpTxn txnp, void *strategyTxn, const char *exclude_hostname, size_t exclude_hostname_len, - in_port_t exclude_port, const char **out_hostname, size_t *out_hostname_len, in_port_t *out_port, - bool *out_retry, bool *out_no_cache, time_t now) +PLNextHopConsistentHash::next(TSHttpTxn txnp, void *strategyTxn, const char **out_hostname, size_t *out_hostname_len, + in_port_t *out_port, bool *out_retry, bool *out_no_cache, time_t now) { // TODO add logic in the strategy to track when someone is retrying, and not give it out to multiple threads at once, to prevent // thundering retries See github issue #7485 diff --git a/plugins/experimental/parent_select/consistenthash.h b/plugins/experimental/parent_select/consistenthash.h index c24a2fb4e..0f3bea8e5 100644 --- a/plugins/experimental/parent_select/consistenthash.h +++ b/plugins/experimental/parent_select/consistenthash.h @@ -75,9 +75,8 @@ public: PLNextHopConsistentHash() = delete; PLNextHopConsistentHash(const std::string_view name, const YAML::Node &n); ~PLNextHopConsistentHash(); - void next(TSHttpTxn txnp, void *strategyTxn, const char *exclude_hostname, size_t exclude_hostname_len, in_port_t exclude_port, - const char **out_hostname, size_t *out_hostname_len, in_port_t *out_port, bool *out_retry, bool *out_no_cache, - time_t now = 0) override; + void next(TSHttpTxn txnp, void *strategyTxn, const char **out_hostname, size_t *out_hostname_len, in_port_t *out_port, + bool *out_retry, bool *out_no_cache, time_t now = 0) override; void mark(TSHttpTxn txnp, void *strategyTxn, const char *hostname, const size_t hostname_len, const in_port_t port, const PLNHCmd status, const time_t now) override; void *newTxn() override; diff --git a/plugins/experimental/parent_select/parent_select.cc b/plugins/experimental/parent_select/parent_select.cc index e3df98393..0408ac39e 100644 --- a/plugins/experimental/parent_select/parent_select.cc +++ b/plugins/experimental/parent_select/parent_select.cc @@ -128,6 +128,7 @@ handle_read_response(TSHttpTxn txnp, StrategyTxn *strategyTxn) TSResponseAction ra; TSHttpTxnResponseActionGet(txnp, &ra); ra.responseIsRetryable = strategy->responseIsRetryable(strategyTxn->request_count - 1, status); + TSHttpTxnResponseActionSet(txnp, &ra); } @@ -168,11 +169,7 @@ handle_os_dns(TSHttpTxn txnp, StrategyTxn *strategyTxn) TSResponseAction ra; memset(&ra, 0, sizeof(TSResponseAction)); - const char *const exclude_host = strategyTxn->prev_ra.hostname; - const size_t exclude_host_len = strategyTxn->prev_ra.hostname_len; - const in_port_t exclude_port = strategyTxn->prev_ra.port; - strategy->next(txnp, strategyTxn->txn, exclude_host, exclude_host_len, exclude_port, &ra.hostname, &ra.hostname_len, &ra.port, - &ra.is_retry, &ra.no_cache); + strategy->next(txnp, strategyTxn->txn, &ra.hostname, &ra.hostname_len, &ra.port, &ra.is_retry, &ra.no_cache); ra.fail = ra.hostname == nullptr; // failed is whether to immediately fail and return the client a 502. In this case: whether or // not we found another parent. @@ -340,11 +337,7 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri) TSResponseAction ra; memset(&ra, 0, sizeof(TSResponseAction)); // because {0} gives a C++ warning. Ugh. - constexpr const char *const exclude_host = nullptr; - constexpr const size_t exclude_host_len = 0; - constexpr const in_port_t exclude_port = 0; - strategy->next(txnp, strategyTxn->txn, exclude_host, exclude_host_len, exclude_port, &ra.hostname, &ra.hostname_len, &ra.port, - &ra.is_retry, &ra.no_cache); + strategy->next(txnp, strategyTxn->txn, &ra.hostname, &ra.hostname_len, &ra.port, &ra.is_retry, &ra.no_cache); ra.nextHopExists = ra.hostname != nullptr; ra.fail = !ra.nextHopExists; diff --git a/plugins/experimental/parent_select/strategy.h b/plugins/experimental/parent_select/strategy.h index e2db4fcc2..eab0e6bd0 100644 --- a/plugins/experimental/parent_select/strategy.h +++ b/plugins/experimental/parent_select/strategy.h @@ -220,8 +220,7 @@ public: virtual ~TSNextHopSelectionStrategy(){}; virtual const char *name() = 0; - virtual void next(TSHttpTxn txnp, void *strategyTxn, const char *exclude_hostname, size_t exclude_hostname_len, - in_port_t exclude_port, const char **out_hostname, size_t *out_hostname_len, in_port_t *out_port, + virtual void next(TSHttpTxn txnp, void *strategyTxn, const char **out_hostname, size_t *out_hostname_len, in_port_t *out_port, bool *out_retry, bool *out_no_cache, time_t now = 0) = 0; virtual void mark(TSHttpTxn txnp, void *strategyTxn, const char *hostname, const size_t hostname_len, const in_port_t port, const PLNHCmd status, const time_t now = 0) = 0; @@ -244,11 +243,10 @@ public: PLNextHopSelectionStrategy(const std::string_view &name, const YAML::Node &n); virtual ~PLNextHopSelectionStrategy(){}; - void next(TSHttpTxn txnp, void *strategyTxn, const char *exclude_hostname, size_t exclude_hostname_len, in_port_t exclude_port, - const char **out_hostname, size_t *out_hostname_len, in_port_t *out_port, bool *out_retry, bool *out_no_cache, - time_t now = 0) override = 0; + void next(TSHttpTxn txnp, void *strategyTxn, const char **out_hostname, size_t *out_hostname_len, in_port_t *out_port, + bool *out_retry, bool *out_no_cache, time_t now = 0) override = 0; void mark(TSHttpTxn txnp, void *strategyTxn, const char *hostname, const size_t hostname_len, const in_port_t port, - const PLNHCmd status, const time_t now = 0) override = 0; + const PLNHCmd status, const time_t now = 0) override = 0; bool nextHopExists(TSHttpTxn txnp) override; bool codeIsFailure(TSHttpStatus response_code) override; bool responseIsRetryable(unsigned int current_retry_attempts, TSHttpStatus response_code) override;
