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
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
neoppod
Commits
f456cfaa
Commit
f456cfaa
authored
Aug 14, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8acb9b73
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
go/neo/server/storage.go
go/neo/server/storage.go
+14
-7
No files found.
go/neo/server/storage.go
View file @
f456cfaa
...
...
@@ -199,7 +199,7 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
// accept next connection from master. only 1 connection is served at any given time.
// every new connection from master means talk over previous connection is cancelled.
// XXX check compatibility with py
// XXX
re
check compatibility with py
acceptq
:=
make
(
chan
*
neo
.
Conn
,
1
)
go
func
()
{
for
{
...
...
@@ -212,11 +212,19 @@ func (stor *Storage) talkMaster1(ctx context.Context) (err error) {
}
}()
//
now
handle notifications and commands from master
// handle notifications and commands from master
talkq
:=
make
(
chan
error
,
1
)
loop
:
for
{
// one talk cycle for master to drive us over Mconn
// wait for next connection from master if talk over previous one finished.
if
Mconn
==
nil
{
select
{
case
Mconn
=
<-
acceptq
:
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
}
}
// one talk cycle for master to drive us
// puts error after talk finishes -> talkq
talk
:=
func
()
error
{
// let master initialize us. If successful this ends with StartOperation command.
...
...
@@ -239,7 +247,8 @@ loop:
select
{
case
err
=
<-
talkq
:
// XXX check for shutdown command
continue
loop
// retry from initializing
lclose
(
ctx
,
Mconn
)
Mconn
=
nil
// now wait for accept to get next Mconn
case
conn
:=
<-
acceptq
:
lclose
(
ctx
,
Mconn
)
// wakeup/cancel current talk
...
...
@@ -250,8 +259,6 @@ loop:
return
ctx
.
Err
()
}
}
return
nil
// XXX err
}
// m1initialize drives storage by master messages during initialization phase
...
...
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