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.
This commit is contained in:
Sean Chittenden 2017-02-01 15:51:25 -08:00
parent 1d9c5a3efb
commit 6844ebb43b
No known key found for this signature in database
GPG key ID: 4EBC9DC16C2E5E16

View file

@ -702,10 +702,13 @@ func (s *StateStore) NodeServices(ws memdb.WatchSet, nodeNameOrID string) (uint6
return 0, nil, nil
}
// Attempt to lookup the node by it's node ID
// Attempt to lookup the node by its node ID
iter, err := tx.Get("nodes", "uuid_prefix", nodeNameOrID)
if err != nil {
return 0, nil, fmt.Errorf("node ID lookup failed: %s", err)
ws.Add(watchCh)
// TODO(sean@): We could/should log an error re: the uuid_prefix lookup
// failing once a logger has been introduced to the catalog.
return 0, nil, nil
}
n = iter.Next()
if n == nil {