mirror of https://github.com/status-im/consul.git
Treat a uuid prefix lookup error as a soft error, as if a node name
lookup returned nil. Add a TODO to note where a future point of logging should occur once a logger is present and a few additional comments to explain the program flow.
This commit is contained in:
parent
62527c1698
commit
c16f33402a
|
@ -710,16 +710,18 @@ func (s *StateStore) NodeServices(ws memdb.WatchSet, nodeNameOrID string) (uint6
|
|||
// failing once a logger has been introduced to the catalog.
|
||||
return 0, nil, nil
|
||||
}
|
||||
|
||||
n = iter.Next()
|
||||
if n == nil {
|
||||
// No nodes matched, even with the Node ID: add a watch on the node name.
|
||||
ws.Add(watchCh)
|
||||
return 0, nil, nil
|
||||
}
|
||||
|
||||
idWatchCh := iter.WatchCh()
|
||||
if iter.Next() != nil {
|
||||
// Watch on the channel that did a node name lookup if we don't find
|
||||
// anything when searching by Node ID.
|
||||
// More than one match present: Watch on the node name channel and return
|
||||
// an empty result (node lookups can not be ambiguous).
|
||||
ws.Add(watchCh)
|
||||
return 0, nil, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue