mirror of
https://github.com/status-im/consul.git
synced 2025-02-19 17:14:37 +00:00
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.
|
// failing once a logger has been introduced to the catalog.
|
||||||
return 0, nil, nil
|
return 0, nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
n = iter.Next()
|
n = iter.Next()
|
||||||
if n == nil {
|
if n == nil {
|
||||||
|
// No nodes matched, even with the Node ID: add a watch on the node name.
|
||||||
ws.Add(watchCh)
|
ws.Add(watchCh)
|
||||||
return 0, nil, nil
|
return 0, nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
idWatchCh := iter.WatchCh()
|
idWatchCh := iter.WatchCh()
|
||||||
if iter.Next() != nil {
|
if iter.Next() != nil {
|
||||||
// Watch on the channel that did a node name lookup if we don't find
|
// More than one match present: Watch on the node name channel and return
|
||||||
// anything when searching by Node ID.
|
// an empty result (node lookups can not be ambiguous).
|
||||||
ws.Add(watchCh)
|
ws.Add(watchCh)
|
||||||
return 0, nil, nil
|
return 0, nil, nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user