Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
83dbe4c7
Commit
83dbe4c7
authored
Oct 17, 2022
by
Jonah Husson
Browse files
Options
Downloads
Patches
Plain Diff
Fix host pool size checking
parent
aedcb7c1
Branches
Branches containing commit
Tags
Tags containing commit
4 merge requests
!510
Release
,
!419
rewrote the health tracker to both consider if there are waiting rounds and...
,
!414
Fix host pool size checking
,
!340
Project/channels
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmix/gateway/hostPool.go
+3
-9
3 additions, 9 deletions
cmix/gateway/hostPool.go
with
3 additions
and
9 deletions
cmix/gateway/hostPool.go
+
3
−
9
View file @
83dbe4c7
...
...
@@ -307,11 +307,13 @@ func (h *HostPool) initialize(startIdx uint32) error {
id
*
id
.
ID
latency
time
.
Duration
}
numGatewaysToTry
:=
h
.
poolParams
.
MaxPings
numGateways
:=
uint32
(
len
(
randomGateways
))
if
numGatewaysToTry
>
numGateways
{
numGatewaysToTry
=
numGateways
}
resultList
:=
make
([]
gatewayDuration
,
0
,
numGatewaysToTry
)
// Begin trying gateways
...
...
@@ -320,12 +322,6 @@ func (h *HostPool) initialize(startIdx uint32) error {
i
:=
uint32
(
0
)
for
!
exit
{
for
;
i
<
numGateways
;
i
++
{
// Ran out of Hosts to try
if
i
>=
numGateways
{
exit
=
true
break
}
// Select a gateway not yet selected
gwId
,
err
:=
randomGateways
[
i
]
.
GetGatewayId
()
if
err
!=
nil
{
...
...
@@ -334,8 +330,6 @@ func (h *HostPool) initialize(startIdx uint32) error {
// Skip if already in HostPool
if
_
,
ok
:=
h
.
hostMap
[
*
gwId
];
ok
{
// Try another Host instead
numGatewaysToTry
++
continue
}
...
...
@@ -370,7 +364,7 @@ func (h *HostPool) initialize(startIdx uint32) error {
}
// Break if we have all needed slots
if
uint32
(
len
(
resultList
))
==
numGatewaysToTry
{
if
uint32
(
len
(
resultList
))
==
numGatewaysToTry
||
i
>=
numGateways
{
exit
=
true
timer
.
Stop
()
break
innerLoop
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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