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
fb3dcb0d
Commit
fb3dcb0d
authored
Sep 11, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
X stor shutdown hackily works
parent
533d3a3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
go/neo/server/storage.go
go/neo/server/storage.go
+10
-2
No files found.
go/neo/server/storage.go
View file @
fb3dcb0d
...
@@ -94,7 +94,14 @@ func (stor *Storage) Run(ctx context.Context) error {
...
@@ -94,7 +94,14 @@ func (stor *Storage) Run(ctx context.Context) error {
// start serving incoming connections
// start serving incoming connections
wg
:=
sync
.
WaitGroup
{}
wg
:=
sync
.
WaitGroup
{}
serveCtx
,
serveCancel
:=
context
.
WithCancel
(
ctx
)
serveCtx
,
serveCancel
:=
context
.
WithCancel
(
ctx
)
stor
.
node
.
OnShutdown
=
serveCancel
//stor.node.OnShutdown = serveCancel
// XXX hack: until ctx cancel is not handled properly by Recv/Send
stor
.
node
.
OnShutdown
=
func
()
{
serveCancel
()
lclose
(
ctx
,
l
)
}
wg
.
Add
(
1
)
wg
.
Add
(
1
)
go
func
(
ctx
context
.
Context
)
(
err
error
)
{
go
func
(
ctx
context
.
Context
)
(
err
error
)
{
defer
wg
.
Done
()
defer
wg
.
Done
()
...
@@ -133,7 +140,8 @@ func (stor *Storage) Run(ctx context.Context) error {
...
@@ -133,7 +140,8 @@ func (stor *Storage) Run(ctx context.Context) error {
}(
serveCtx
)
}(
serveCtx
)
// connect to master and get commands and updates from it
// connect to master and get commands and updates from it
err
=
stor
.
talkMaster
(
ctx
)
//err = stor.talkMaster(ctx)
err
=
stor
.
talkMaster
(
serveCtx
)
// XXX hack for shutdown
// XXX log err?
// XXX log err?
// we are done - shutdown
// we are done - shutdown
...
...
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