Skip device on discovery errors when enabled - #407
Conversation
Greptile SummaryThis PR adds an opt-in path for skipping devices with discovery read errors. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "Skip device on discovery errors when ena..." | Re-trigger Greptile |
| if err != nil { | ||
| log.Log.Error(err, "Failed to get device's firmware and PSID", "address", device.Address) | ||
| if skipDeviceOnDiscoveryError { | ||
| continue |
There was a problem hiding this comment.
Physical NIC Partially Discovered
When firmware or PSID lookup fails for the first PCI function of a multi-function NIC, this continue skips only that function. A later function with the same collapsed PCI key can still initialize the device, so discovery can return a NicDevice with only the later port instead of skipping the whole physical NIC.
| if err != nil { | ||
| log.Log.Error(err, "Failed to get BlueField device's operation mode", "address", device.Address) | ||
| if skipDeviceOnDiscoveryError { | ||
| continue |
There was a problem hiding this comment.
When operation-mode lookup fails for one BlueField PCI function but succeeds for a later function with the same collapsed PCI key, this branch skips only the failed function. Discovery can still create the device from the later function, leaving the returned NicDevice with a truncated Ports list and DPU metadata from whichever function first succeeds.
| if err != nil { | ||
| log.Log.Error(err, "Failed to get device's firmware and PSID", "address", device.Address) | ||
| if skipDeviceOnDiscoveryError { | ||
| continue |
There was a problem hiding this comment.
With the flag enabled, a transient firmware or PSID lookup failure omits the device from the returned discovery map while returning no error. The controller treats missing discovered devices as removed hardware and deletes existing NicDevice CRs, so a flaky per-device lookup can cause delete/recreate churn instead of just skipping updates for that device.
Signed-off-by: Alexander Maslennikov <amaslennikov@nvidia.com>
cdcdb7d to
55b11b3
Compare
|
Addressed the Greptile findings and force-pushed amended commit
Validation: |
Signed-off-by: Alexander Maslennikov <amaslennikov@nvidia.com> (cherry picked from commit d09e793)
Summary
Testing