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
1059b27f
Commit
1059b27f
authored
Feb 12, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
00845e93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
go/neo/master.go
go/neo/master.go
+8
-3
No files found.
go/neo/master.go
View file @
1059b27f
...
...
@@ -1219,7 +1219,7 @@ func (m *Master) identify(ctx context.Context, n nodeCome) (peer *_MasteredPeer,
// spawn task to send accept and proxy δnodeTab/δpartTab to the peer
peer
.
wg
.
Go
(
func
(
ctx
context
.
Context
)
error
{
// go main <- peer "peer (should be) disconnected" when all peer's task finish
m
.
mainWG
.
Go
(
func
(
_
context
.
Context
)
error
{
m
.
mainWG
.
Go
(
func
(
ctx
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
...
...
@@ -1227,8 +1227,13 @@ func (m *Master) identify(ctx context.Context, n nodeCome) (peer *_MasteredPeer,
// 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() ?
select
{
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
case
m
.
nodeLeaveq
<-
nodeLeave
{
peer
,
err
}
:
return
nil
// ok
}
})
// XXX err -> indicated that accept0 failed ?
...
...
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