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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
ab7a84fa
Commit
ab7a84fa
authored
2 years ago
by
Jono Wenger
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/delayedRegistration' into delayedRegistration
parents
e57a0436
876a8e2d
No related branches found
No related tags found
2 merge requests
!510
Release
,
!431
made lower paralell regs unique to js and hacked increase in num registrations...
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bindings/follow.go
+6
-0
6 additions, 0 deletions
bindings/follow.go
cmix/nodes/registrar.go
+23
-7
23 additions, 7 deletions
cmix/nodes/registrar.go
xxdk/cmix.go
+8
-0
8 additions, 0 deletions
xxdk/cmix.go
with
37 additions
and
7 deletions
bindings/follow.go
+
6
−
0
View file @
ab7a84fa
...
...
@@ -188,6 +188,12 @@ func (c *Cmix) AddHealthCallback(nhc NetworkHealthCallback) int64 {
return
int64
(
c
.
api
.
GetCmix
()
.
AddHealthCallback
(
nhc
.
Callback
))
}
// IncreaseParallelNodeRegistration increases the number of parallel node
// registrations by num
func
(
c
*
Cmix
)
IncreaseParallelNodeRegistration
(
num
int
)
error
{
return
c
.
api
.
IncreaseParallelNodeRegistration
(
num
)
}
// RemoveHealthCallback removes a health callback using its registration ID.
func
(
c
*
Cmix
)
RemoveHealthCallback
(
funcID
int64
)
{
c
.
api
.
GetCmix
()
.
RemoveHealthCallback
(
uint64
(
funcID
))
...
...
This diff is collapsed.
Click to expand it.
cmix/nodes/registrar.go
+
23
−
7
View file @
ab7a84fa
...
...
@@ -46,6 +46,11 @@ type registrar struct {
comms
RegisterNodeCommsInterface
rng
*
fastRNG
.
StreamGenerator
inProgress
sync
.
Map
// We are relying on the in progress check to ensure there is only a single
// operator at a time, as a result this is a map of ID -> int
attempts
sync
.
Map
c
chan
network
.
NodeGateway
}
...
...
@@ -91,22 +96,33 @@ func LoadRegistrar(session session, sender gateway.Sender,
func
(
r
*
registrar
)
StartProcesses
(
numParallel
uint
)
stoppable
.
Stoppable
{
multi
:=
stoppable
.
NewMulti
(
"NodeRegistrations"
)
inProgress
:=
&
sync
.
Map
{}
// We are relying on the in progress check to ensure there is only a single
// operator at a time, as a result this is a map of ID -> int
attempts
:=
&
sync
.
Map
{}
for
i
:=
uint
(
0
);
i
<
numParallel
;
i
++
{
stop
:=
stoppable
.
NewSingle
(
"NodeRegistration "
+
strconv
.
Itoa
(
int
(
i
)))
go
registerNodes
(
r
,
r
.
session
,
stop
,
inProgress
,
attempts
)
go
registerNodes
(
r
,
r
.
session
,
stop
,
&
r
.
inProgress
,
&
r
.
attempts
)
multi
.
Add
(
stop
)
}
return
multi
}
// IncreaseParallelNodeRegistration increases the number of parallel node
// registrations by num
func
(
r
*
registrar
)
IncreaseParallelNodeRegistration
(
numParallel
uint
)
func
()
(
stoppable
.
Stoppable
,
error
)
{
return
func
()
(
stoppable
.
Stoppable
,
error
)
{
multi
:=
stoppable
.
NewMulti
(
"NodeRegistrationsIncrease"
)
for
i
:=
uint
(
0
);
i
<
numParallel
;
i
++
{
stop
:=
stoppable
.
NewSingle
(
"NodeRegistration Increase"
+
strconv
.
Itoa
(
int
(
i
)))
go
registerNodes
(
r
,
r
.
session
,
stop
,
&
r
.
inProgress
,
&
r
.
attempts
)
multi
.
Add
(
stop
)
}
return
multi
,
nil
}
}
// GetNodeKeys returns a MixCypher for the topology and a list of nodes it did
// not have a key for. If there are missing keys, then returns nil.
func
(
r
*
registrar
)
GetNodeKeys
(
topology
*
connect
.
Circuit
)
(
MixCypher
,
error
)
{
...
...
This diff is collapsed.
Click to expand it.
xxdk/cmix.go
+
8
−
0
View file @
ab7a84fa
...
...
@@ -484,6 +484,14 @@ func (c *Cmix) GetNodeRegistrationStatus() (int, int, error) {
return
numRegistered
,
len
(
nodes
)
-
numStale
,
nil
}
// IncreaseParallelNodeRegistration increases the number of parallel node
// registrations by num
func
(
c
*
Cmix
)
IncreaseParallelNodeRegistration
(
num
int
)
error
{
jww
.
INFO
.
Printf
(
"IncreaseParallelNodeRegistration(%d)"
,
num
)
svc
:=
c
.
network
.
IncreaseParallelNodeRegistration
(
num
)
return
c
.
followerServices
.
add
(
svc
)
}
// GetPreferredBins returns the geographic bin or bins that the provided two
// character country code is a part of.
func
(
c
*
Cmix
)
GetPreferredBins
(
countryCode
string
)
([]
string
,
error
)
{
...
...
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