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
bedbf112
Commit
bedbf112
authored
Feb 12, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f70489a3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
go/neo/master.go
go/neo/master.go
+15
-1
No files found.
go/neo/master.go
View file @
bedbf112
...
...
@@ -1336,7 +1336,19 @@ func (m *Master) __accept(peer *_MasteredPeer, idReq *neonet.Request) error {
// TODO indicate that initial phase of accept is done
peer
.
wg
.
Go
(
peer
.
notify
)
// main -> peer δnodeTab/δpartTab/δcluterState to proxy to peer link
m
.
mainWG
.
Go
(
peer
.
waitAll
)
// main <- peer "peer (should be) disconnected"
// go main <- peer "peer (should be) disconnected"
m
.
mainWG
.
Go
(
func
(
_
context
.
Context
)
error
{
// wait for all tasks related to peer to complete and then
// notify main that peer node should go. Don't take ctx into
// account - it is ~ runCtx and should be parent of context
// under which per-peer tasks are spawned. This way if runCtx
// is canceled -> any per-peer ctx should be canceled too and
// wg.Wait should not block.
err
:=
peer
.
wg
.
Wait
()
m
.
nodeLeaveq
<-
nodeLeave
{
peer
,
err
}
// XXX detect if if main is already done
return
nil
// XXX or ctx.Err() ?
})
return
nil
}
...
...
@@ -1403,6 +1415,7 @@ func (p *_MasteredPeer) notify(ctx context.Context) (err error) {
return
nil
}
/*
// waitAll waits for all tasks related to peer to complete and then notifies
// main that peer node should go. It is spawned under mainWG.
// XXX naming -> wait?
...
...
@@ -1417,6 +1430,7 @@ func (p *_MasteredPeer) waitAll(_ context.Context) error {
m.nodeLeaveq <- nodeLeave{p, err} // XXX detect if if main is already done
return nil // XXX or ctx.Err() ?
}
*/
// XXX run runs f after initial phase of peer acceptance is over.
//
...
...
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