Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
93094ed5
Commit
93094ed5
authored
4 years ago
by
LaurenceLiZhixin
Browse files
Options
Downloads
Patches
Plain Diff
fix: cr
parent
edd99f59
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cluster/cluster_impl/base_cluster_invoker.go
+6
-5
6 additions, 5 deletions
cluster/cluster_impl/base_cluster_invoker.go
protocol/rpc_status.go
+2
-4
2 additions, 4 deletions
protocol/rpc_status.go
with
8 additions
and
9 deletions
cluster/cluster_impl/base_cluster_invoker.go
+
6
−
5
View file @
93094ed5
...
...
@@ -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
{
...
...
This diff is collapsed.
Click to expand it.
protocol/rpc_status.go
+
2
−
4
View file @
93094ed5
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment