Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
0fdf4c40
Commit
0fdf4c40
authored
Feb 18, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
bb5aa1ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
23 deletions
+21
-23
go/neo/master.go
go/neo/master.go
+21
-23
No files found.
go/neo/master.go
View file @
0fdf4c40
...
...
@@ -1047,29 +1047,6 @@ func (m *Master) updateNodeState(ctx context.Context, peer *xneo.PeerNode, state
m
.
updateNodeTab
(
ctx
,
nodei
)
}
// notifyAll notifies all peers about δstate event.
// XXX move close to _MasteredPeer.notify
func
(
m
*
Master
)
notifyAll
(
ctx
context
.
Context
,
event
_ΔClusterState
)
{
for
nid
,
peer
:=
range
m
.
peerTab
{
// TODO change limiting by buffer size to limiting by time -
// - i.e. detach peer if event queue grows more than 30s of time.
select
{
case
peer
.
notifyq
<-
event
:
continue
// ok
default
:
}
// XXX try to move logging into other place - so that we could remove ctx arg here
log
.
Warningf
(
ctx
,
"peer %s is slow -> detaching it"
,
nid
)
close
(
peer
.
notifyqOverflow
)
// TODO delete(m.peerTab, nid) -> p.cancel()
// XXX what else?
panic
(
"TODO"
)
}
}
// ----------------------------------------
// identify processes identification request of just connected node and either accepts or declines it.
...
...
@@ -1271,6 +1248,27 @@ func (p *_MasteredPeer) accept(ctx context.Context) (err error) {
return
nil
}
// notifyAll notifies all peers about δstate event.
func
(
m
*
Master
)
notifyAll
(
ctx
context
.
Context
,
event
_ΔClusterState
)
{
for
nid
,
peer
:=
range
m
.
peerTab
{
// TODO change limiting by buffer size to limiting by time -
// - i.e. detach peer if event queue grows more than 30s of time.
select
{
case
peer
.
notifyq
<-
event
:
continue
// ok
default
:
}
// XXX try to move logging into other place - so that we could remove ctx arg here
log
.
Warningf
(
ctx
,
"peer %s is slow -> detaching it"
,
nid
)
close
(
peer
.
notifyqOverflow
)
// TODO delete(m.peerTab, nid) -> p.cancel()
// XXX what else?
panic
(
"TODO"
)
}
}
// notify proxies δnodeTab/δpartTab/δClusterState update to the peer.
func
(
p
*
_MasteredPeer
)
notify
(
ctx
context
.
Context
)
(
err
error
)
{
defer
task
.
Runningf
(
&
ctx
,
"notify %s"
,
p
.
node
.
NID
)(
&
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment