Mark devices unhealthy when health monitoring cannot initialize - #2037
Open
Shivkumar13 wants to merge 1 commit into
Open
Shivkumar13 wants to merge 1 commit into
Shivkumar13 wants to merge 1 commit into
Conversation
Report managed devices unhealthy when NVML initialization or event-set creation fails during health-check setup. Make the new notifications cancellation-aware and preserve initialization-error and bypass policies. Capture health-check lifecycle channels before starting the goroutine and remove the misleading continuing-with-checks-disabled log message. Add mocked-NVML regression tests and ListAndWatch coverage, including reconnect state and shutdown during notification. Related to NVIDIA#1640. Signed-off-by: Shivkumar Ople <sople@nvidia.com>
Shivkumar13
marked this pull request as ready for review
September 16, 2026 14:15
Author
|
Please take a look, Thank you @tariq1890 |
kvalliyurnatt
approved these changes
Sep 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When NVML initialization or event-set creation fails after device discovery, health monitoring exits without reporting the devices unhealthy. The plugin can remain connected to kubelet with its last Healthy device list, even though health monitoring is unavailable.
Report every device managed by the affected resource manager through the existing unhealthy notification channel before returning from either setup failure. Stop-aware sends allow shutdown when ListAndWatch is not receiving notifications. Preserve the existing FAIL_ON_INIT_ERROR return behavior and explicit health-check bypasses, and update the plugin error log to describe the failure accurately.
Related to #1640. This addresses the health-monitor setup failure path described there; it does not claim to resolve every allocation failure or the complete reported incident. Initial Healthy publication before health-check setup, per-device discovery/allocation isolation, and CDI behavior are unchanged. Devices follow the existing Unhealthy lifecycle; monitor retries and automatic recovery are outside this change.
Checklist
make lint)make test)make check-modules)make check-third-party-notices)Testing
Deterministic mocked-NVML tests cover initialization failure with both FAIL_ON_INIT_ERROR values, event-set creation failure, cleanup, explicit bypasses, and shutdown during unbuffered unhealthy notification. A protocol test uses the real resource manager and ListAndWatch implementation to verify that setup failure produces an all-Unhealthy response and that a subsequent stream retains that state.
Validated on Linux/amd64 with Go 1.26.0:
go test ./internal/rm ./internal/plugin -count=1passes with the change.make testpasses, including its build targets and all cmd/internal/api unit tests.go test -race ./internal/rm ./internal/plugin -count=1passes.make lintpasses with golangci-lint v2.13.2 (0 issues).make check-modulesandmake -C deployments/devel check-modulespass with no module/vendor changes.make check-third-party-noticespasses with no notice changes.The ListAndWatch tests invoke the real handler with a test stream; they do not run a kubelet or Kubernetes cluster. No physical GPU failure or customer environment reproduction is claimed. The initial Healthy response remains covered as existing behavior; preventing it is separate follow-up work.