Skip to content

Commit

Permalink
Fix bug that will return closed successor
Browse files Browse the repository at this point in the history
Signed-off-by: Yilun <[email protected]>
  • Loading branch information
yilunzhang authored and doraemon0 committed Sep 10, 2018
1 parent 2f5777c commit 2bde0ee
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/chord/vnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,11 @@ func (vn *localVnode) FindSuccessors(n int, key []byte) ([]*Vnode, error) {

// Try that node, break on success
res, err := vn.ring.transport.FindSuccessors(closest, n, key)
if err != nil {
if err == nil {
return res, nil
} else {
nlog.Infof("[WARNING] Failed to contact %s. Got %s", closest.String(), err)
}
return res, nil
}

// Determine how many successors we know of
Expand Down

0 comments on commit 2bde0ee

Please sign in to comment.