Commit 0cb61251 authored by Levin Zimmermann's avatar Levin Zimmermann

.

parent 995a128c
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment