@@ -194,17 +194,17 @@ bool UPSGroupPolicy::select(const ParsedURI& uri, WFNSTracing *tracing,
194194}
195195
196196/*
197- * flag true : return an available one. If not exists, return NULL.
198- * false: means addr maybe group-alive.
199- * If addr is not available, get one from addr->group.
197+ * addr_failed true: return an available one. If not exists, return NULL.
198+ * false: means addr maybe group-alive.
199+ * If addr is not available, get one from addr->group.
200200 */
201201EndpointAddress *UPSGroupPolicy::check_and_get (EndpointAddress *addr,
202- bool flag ,
202+ bool addr_failed ,
203203 WFNSTracing *tracing)
204204{
205205 UPSAddrParams *params = static_cast <UPSAddrParams *>(addr->params );
206206
207- if (flag == true ) // && addr-> fail_count >= addr->params-> max_fails
207+ if (addr_failed == true ) // means fail_count >= max_fails
208208 {
209209 if (params->group_id == -1 )
210210 return NULL ;
@@ -397,7 +397,8 @@ int UPSGroupPolicy::remove_server_locked(const std::string& address)
397397 return ret;
398398}
399399
400- EndpointAddress *UPSGroupPolicy::consistent_hash_with_group (unsigned int hash)
400+ EndpointAddress *UPSGroupPolicy::consistent_hash_with_group (unsigned int hash,
401+ WFNSTracing *tracing)
401402{
402403 const UPSAddrParams *params;
403404 EndpointAddress *addr = NULL ;
@@ -427,7 +428,7 @@ EndpointAddress *UPSGroupPolicy::consistent_hash_with_group(unsigned int hash)
427428 if (!addr)
428429 return NULL ;
429430
430- return this ->check_and_get (addr, false , NULL );
431+ return this ->check_and_get (addr, false , tracing );
431432}
432433
433434void UPSWeightedRandomPolicy::add_server_locked (EndpointAddress *addr)
@@ -636,7 +637,7 @@ EndpointAddress *UPSConsistentHashPolicy::first_strategy(const ParsedURI& uri,
636637 uri.path ? uri.path : " " ,
637638 uri.query ? uri.query : " " ,
638639 uri.fragment ? uri.fragment : " " );
639- return this ->consistent_hash_with_group (hash_value);
640+ return this ->consistent_hash_with_group (hash_value, tracing );
640641}
641642
642643EndpointAddress *UPSManualPolicy::first_strategy (const ParsedURI& uri,
@@ -659,6 +660,6 @@ EndpointAddress *UPSManualPolicy::another_strategy(const ParsedURI& uri,
659660 uri.path ? uri.path : " " ,
660661 uri.query ? uri.query : " " ,
661662 uri.fragment ? uri.fragment : " " );
662- return this ->consistent_hash_with_group (hash_value);
663+ return this ->consistent_hash_with_group (hash_value, tracing );
663664}
664665
0 commit comments