Skip to content
Snippets Groups Projects
Commit 93094ed5 authored by LaurenceLiZhixin's avatar LaurenceLiZhixin
Browse files

fix: cr

parent edd99f59
No related branches found
No related tags found
No related merge requests found
......@@ -143,8 +143,7 @@ func (invoker *baseClusterInvoker) doSelectInvoker(lb cluster.LoadBalance, invoc
for i := 0; i < 3; i++ {
if len(otherInvokers) == 0 {
// no other ivk to reselect, return to fallback
logger.Errorf("all %d invokers is unavailable for %s.", len(invokers), selectedInvoker.GetUrl().String())
return nil
break
}
reselectedInvoker := lb.Select(otherInvokers, invocation)
if isInvoked(reselectedInvoker, invoked) {
......@@ -158,11 +157,13 @@ func (invoker *baseClusterInvoker) doSelectInvoker(lb cluster.LoadBalance, invoc
otherInvokers = getOtherInvokers(otherInvokers, reselectedInvoker)
continue
}
selectedInvoker = reselectedInvoker
break
return reselectedInvoker
}
} else {
return selectedInvoker
}
return selectedInvoker
logger.Errorf("all %d invokers is unavailable for %s.", len(invokers), selectedInvoker.GetUrl().String())
return nil
}
func (invoker *baseClusterInvoker) Invoke(ctx context.Context, invocation protocol.Invocation) protocol.Result {
......
......@@ -264,10 +264,8 @@ func TryRefreshBlackList() {
go func(ivks []Invoker, i int) {
defer wg.Done()
for j, _ := range ivks {
if j%3-i == 0 {
if ivks[j].(Invoker).IsAvailable() {
RemoveInvokerUnhealthyStatus(ivks[i])
}
if j%3-i == 0 && ivks[j].(Invoker).IsAvailable() {
RemoveInvokerUnhealthyStatus(ivks[i])
}
}
}(ivks, i)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment