Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
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
Show 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
...
@@ -1047,29 +1047,6 @@ func (m *Master) updateNodeState(ctx context.Context, peer *xneo.PeerNode, state
m
.
updateNodeTab
(
ctx
,
nodei
)
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.
// 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) {
...
@@ -1271,6 +1248,27 @@ func (p *_MasteredPeer) accept(ctx context.Context) (err error) {
return
nil
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.
// notify proxies δnodeTab/δpartTab/δClusterState update to the peer.
func
(
p
*
_MasteredPeer
)
notify
(
ctx
context
.
Context
)
(
err
error
)
{
func
(
p
*
_MasteredPeer
)
notify
(
ctx
context
.
Context
)
(
err
error
)
{
defer
task
.
Runningf
(
&
ctx
,
"notify %s"
,
p
.
node
.
NID
)(
&
err
)
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