fix(device-plugin): skip devices that do not support event based healthchecking - #2393
Conversation
…thchecking nvmlDeviceRegisterEvents returning ERROR_NOT_SUPPORTED means the device cannot report health through the event mechanism, not that it is faulty. The two separate ifs let that return code fall into the unhealthy branch, so the device was handed to ListAndWatch as Unhealthy and kubelet dropped it from the node capacity. There is no way back from that state (see the FIXME in ListAndWatch) and a restart hits the same registration failure again. Use a switch so the two cases are exclusive, matching the surrounding branches that all skip the device. Signed-off-by: wangmin <wangmin@riseunion.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe health check now handles ChangesNVML health registration
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests.
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: archlitchi, Wangmin362 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind bug
What this PR does / why we need it:
nvmlDeviceRegisterEventsreturningERROR_NOT_SUPPORTEDmeans the device cannot report health through the event mechanism, not that it is faulty. The two separateifs let that return code fall through into the second branch, so the device is handed toListAndWatchasUnhealthyand stops being schedulable. That state is not reversible -ListAndWatchcarries aFIXME: there is no way to recover from the Unhealthy state- and a restart only repeats the same failed registration. The logs contradict themselves: one line says the device is "too old to support healthchecking", the next one marks it unhealthy.A
switchmakes the two cases exclusive. NVIDIA fixed the same block upstream in k8s-device-plugin (commit8cd1447, "Fix healthchecking on old devices").Which issue(s) this PR fixes:
NONE
Special notes for your reviewer:
Added a test covering the three
RegisterEventsoutcomes. Checked both ways: withhealth.goreverted to master the test fails on theERROR_NOT_SUPPORTEDassertion, with the fix the package passes.I have no card that answers
ERROR_NOT_SUPPORTEDfor the mask HAMi asks for, so this is not reproduced end to end on a node. I did probe NVML on our test cluster to confirm the return code is reachable in practice: on a GeForce RTX 4090 D (driver 595.71.05)nvmlDeviceRegisterEventsreturnsERROR_NOT_SUPPORTEDfor the ECC event bits, and on a Tesla V100 (driver 550.54.15) for a bit outside its supported mask.This PR was written primarily by Claude Code.
Does this PR introduce a user-facing change?:
Devices that do not support event based health checking are no longer reported as unhealthy, so they stay schedulable.
Summary by CodeRabbit
Bug Fixes
Tests