diff --git a/vendor/github.com/hashicorp/memberlist/net.go b/vendor/github.com/hashicorp/memberlist/net.go index 65a60159d1..58e1fce208 100644 --- a/vendor/github.com/hashicorp/memberlist/net.go +++ b/vendor/github.com/hashicorp/memberlist/net.go @@ -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)) diff --git a/vendor/vendor.json b/vendor/vendor.json index 498fa55da3..26dbb91290 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -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=",