Include backing node request id in metastatic log

When we are satisfying a metastatic request by creating a new backing
node, we can end up logging the message:

  Assigned node 001 to backing node None slot 0

Which is not helpful when trying to find out which backing node 001
was assigned to.  We don't know the node id yet since it hasn't been
created, but in this case we can log the request id.  That can then
be associated with the actual node id in later log entries.

Change-Id: I409917319ab592c997f47e7f69636860fad8c2c9
changes/44/848344/1
James E. Blair 5 months ago
parent eb9121a733
commit 86e5ff9ed6
  1. 4
      nodepool/driver/metastatic/adapter.py

@ -388,9 +388,11 @@ class MetastaticAdapter(statemachine.Adapter):
label.name, label.max_parallel_jobs)
backing_node_record.request_id = req.id
self._addBackingNode(label.name, backing_node_record)
backing_node_log = (backing_node_record.node_id or
f'request {backing_node_record.request_id}')
slot = backing_node_record.allocateSlot(node_id)
self.log.info("Assigned node %s to backing node %s slot %s",
node_id, backing_node_record.node_id, slot)
node_id, backing_node_log, slot)
return backing_node_record, slot
def _addBackingNode(self, label_name, backing_node_record):

Loading…
Cancel
Save