vendor: update github.com/hashicorp/memberlist (#3176)

This commit is contained in:
Kyle Havlovitz 2017-06-22 14:44:46 -07:00 committed by GitHub
parent 43c42b12ae
commit e875cc30fa
2 changed files with 30 additions and 3 deletions

View File

@ -55,6 +55,7 @@ const (
encryptMsg
nackRespMsg
hasCrcMsg
errMsg
)
// compressionType is used to specify the compression algorithm
@ -105,6 +106,11 @@ type nackResp struct {
SeqNo uint32
}
// err response is sent to relay the error from the remote end
type errResp struct {
Error string
}
// suspect is broadcast when we suspect a node is dead
type suspect struct {
Incarnation uint32
@ -209,6 +215,19 @@ func (m *Memberlist) handleConn(conn net.Conn) {
if err != nil {
if err != io.EOF {
m.logger.Printf("[ERR] memberlist: failed to receive: %s %s", err, LogConn(conn))
resp := errResp{err.Error()}
out, err := encode(errMsg, &resp)
if err != nil {
m.logger.Printf("[ERR] memberlist: Failed to encode error response: %s", err)
return
}
err = m.rawSendMsgStream(conn, out.Bytes())
if err != nil {
m.logger.Printf("[ERR] memberlist: Failed to send error: %s %s", err, LogConn(conn))
return
}
}
return
}
@ -726,6 +745,14 @@ func (m *Memberlist) sendAndReceiveState(addr string, join bool) ([]pushNodeStat
return nil, nil, err
}
if msgType == errMsg {
var resp errResp
if err := dec.Decode(&resp); err != nil {
return nil, nil, err
}
return nil, nil, fmt.Errorf("remote error: %v", resp.Error)
}
// Quit if not push/pull
if msgType != pushPullMsg {
err := fmt.Errorf("received invalid msgType (%d), expected pushPullMsg (%d) %s", msgType, pushPullMsg, LogConn(conn))

6
vendor/vendor.json vendored
View File

@ -403,10 +403,10 @@
"revisionTime": "2015-06-09T07:04:31Z"
},
{
"checksumSHA1": "AoIvQFHycqypYK57ZjiWzlQmdwk=",
"checksumSHA1": "uG7wNsy24v7bJxFmWVcL3v5Wvx0=",
"path": "github.com/hashicorp/memberlist",
"revision": "16fe34d996eba2b68f6f46f26c51c617c6bc1bf0",
"revisionTime": "2017-05-26T19:17:51Z"
"revision": "0a136466d82a7e6f1b7866dde3578ac28ed675ad",
"revisionTime": "2017-06-22T10:25:31Z"
},
{
"checksumSHA1": "qnlqWJYV81ENr61SZk9c65R1mDo=",