From abd529b712b142249a7aa82edb228f8de02a48fe Mon Sep 17 00:00:00 2001 From: holmes1412 Date: Wed, 24 Mar 2021 17:54:42 +0800 Subject: [PATCH] add in_select_history() --- src/nameservice/WFServiceGovernance.cc | 4 ++-- src/nameservice/WFServiceGovernance.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/nameservice/WFServiceGovernance.cc b/src/nameservice/WFServiceGovernance.cc index a5015fd0..afd4ca31 100644 --- a/src/nameservice/WFServiceGovernance.cc +++ b/src/nameservice/WFServiceGovernance.cc @@ -321,13 +321,13 @@ bool WFServiceGovernance::select(const ParsedURI& uri, WFNSTracing *tracing, } // select_addr == NULL will only happened in consistent_hash - const EndpointAddress *select_addr = this->first_strategy(uri); + const EndpointAddress *select_addr = this->first_strategy(uri, tracing); if (!select_addr || select_addr->fail_count >= select_addr->params->max_fails) { if (this->try_another) - select_addr = this->another_strategy(uri); + select_addr = this->another_strategy(uri, tracing); } this->rwlock.unlock(); diff --git a/src/nameservice/WFServiceGovernance.h b/src/nameservice/WFServiceGovernance.h index a900f7a1..b2d0afe5 100644 --- a/src/nameservice/WFServiceGovernance.h +++ b/src/nameservice/WFServiceGovernance.h @@ -127,6 +127,7 @@ public: virtual void server_list_change(const EndpointAddress *address, int state) {} void set_mttr_second(unsigned int second) { this->mttr_second = second; } + static bool in_select_history(WFNSTracing *tracing, EndpointAddress *addr); public: WFServiceGovernance()