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
0cb61251
Commit
0cb61251
authored
Apr 26, 2023
by
Levin Zimmermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
995a128c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
1 deletion
+13
-1
go/neo/mastered.go
go/neo/mastered.go
+13
-1
No files found.
go/neo/mastered.go
View file @
0cb61251
...
@@ -22,7 +22,6 @@ package neo
...
@@ -22,7 +22,6 @@ package neo
import
(
import
(
"context"
"context"
"errors"
"fmt"
"fmt"
"sync"
"sync"
"time"
"time"
...
@@ -35,6 +34,8 @@ import (
...
@@ -35,6 +34,8 @@ import (
"lab.nexedi.com/kirr/neo/go/neo/neonet"
"lab.nexedi.com/kirr/neo/go/neo/neonet"
"lab.nexedi.com/kirr/neo/go/neo/proto"
"lab.nexedi.com/kirr/neo/go/neo/proto"
"lab.nexedi.com/kirr/neo/go/neo/xneo"
"lab.nexedi.com/kirr/neo/go/neo/xneo"
"github.com/pkg/errors"
)
)
// _MasteredNode provides base functionality of a NEO node driven by master.
// _MasteredNode provides base functionality of a NEO node driven by master.
...
@@ -130,6 +131,17 @@ func (node *_MasteredNode) TalkMaster(ctx context.Context, f func(context.Contex
...
@@ -130,6 +131,17 @@ func (node *_MasteredNode) TalkMaster(ctx context.Context, f func(context.Contex
if
errors
.
Is
(
err
,
cmdShutdown
)
{
if
errors
.
Is
(
err
,
cmdShutdown
)
{
return
err
// M commands to shutdown
return
err
// M commands to shutdown
}
}
log
.
Warning
(
ctx
,
errors
.
Cause
(
err
))
var
unexpectedMsg
*
neonet
.
ErrUnexpectedMsg
if
errors
.
As
(
err
,
&
unexpectedMsg
)
{
if
unexpectedMsg
.
MsgCode
==
proto
.
MsgCode
(
&
proto
.
NotPrimaryMaster
{})
{
log
.
Warning
(
ctx
,
unexpectedMsg
.
MsgCode
)
log
.
Warning
(
ctx
,
unexpectedMsg
.
Msg
)
}
}
// TODO if err == "reject identification / protocol error" -> shutdown client?
// TODO if err == "reject identification / protocol error" -> shutdown client?
// TODO if err == "not a primary" -> try redirected address
// TODO if err == "not a primary" -> try redirected address
...
...
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