fix(device-plugin): return error on failed Send in ListAndWatch - #2353
Conversation
Signed-off-by: AyushSrivastava1818 <ayush.sri0705@gmail.com>
|
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)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthrough
ChangesListAndWatch stream error handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
... and 21 files with indirect coverage changes 🚀 New features to boost your workflow:
|
…ream NVIDIA device plugin Signed-off-by: AyushSrivastava1818 <ayush.sri0705@gmail.com>
|
/assign @Shouren |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: archlitchi, AyushSrivastava1818, Shouren 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
ListAndWatch()(pkg/device-plugin/nvidiadevice/nvinternal/plugin/server.go) discarded the error returned bys.Send()at both call sites.If the gRPC stream to kubelet becomes unavailable (for example, due to a client disconnect or stream cancellation),
Send()returns an error. The current implementation ignored that error and continued running, causing subsequent device health updates to continue attempting writes on a failed stream.This PR logs and returns the
Send()error at both call sites, allowing the currentListAndWatch()RPC to terminate instead of silently ignoring stream failures. This follows the standard gRPC server-stream error handling pattern already used elsewhere in the codebase.Which issue(s) this PR fixes
Fixes #2352
Special notes for your reviewer
Send()succeeds) path.TestListAndWatch_SendErrorcovering bothSend()call sites:Send()failure.Send()failure after an initial successful send.ListAndWatch()returns the propagated error and stops sending additional updates after the failure.go test ./pkg/device-plugin/nvidiadevice/nvinternal/plugin/... -vmake verifyAI assistance disclosure
I consulted ChatGPT and Claude to identify the issue and discuss the implementation approach. The implementation, tests, validation, commit message, and final code changes were completed and verified by me. I reviewed all generated suggestions, ran the relevant tests and
make verifylocally, and take full responsibility for the final contribution.Does this PR introduce a user-facing change?
Summary by CodeRabbit
Bug Fixes
Tests