Skip to content

fail loudly when post-driver uncordon does not succeed - #210

Open
AcidLeroy wants to merge 1 commit into
NVIDIA:mainfrom
AcidLeroy:fail-on-uncordon-error
Open

fail loudly when post-driver uncordon does not succeed#210
AcidLeroy wants to merge 1 commit into
NVIDIA:mainfrom
AcidLeroy:fail-on-uncordon-error

Conversation

@AcidLeroy

Copy link
Copy Markdown

Fixes #190.

k8s-driver-manager cordons the node, performs its driver work, then calls uncordon and exits. When that final uncordon failed for a transient reason (API-server timeout, 5xx, connection refused), the error was logged with Warnf and swallowed: the init container exited 0 and the pod went Ready, but the node stayed Ready,SchedulingDisabled indefinitely with no controller to reconcile it. The lost capacity was invisible until something downstream noticed.

This change retries the uncordon with a bounded exponential backoff and propagates the error on the main uninstall path, so the init container exits non-zero once the retry budget is exhausted and the next run retries from a known state instead of leaving the node stuck cordoned. The retry budget is configurable via the UNCORDON_RETRIES env var (default 5). The cleanupOnFailure path stays best-effort, matching the existing convention there and the symmetric CordonNode error handling.

The backoff is shared with UpdateNodeLabels through a small RetryBackoff helper so the retry policy lives in one place. Tests use a fake clientset to cover retry-until-success and exit-non-zero-when-exhausted.

NOTE: the symmetric CordonNode still aborts on the first transient error (unchanged here) — only a failed uncordon leaves the node stuck Ready,SchedulingDisabled. Happy to extend the same retry to cordon in a follow-up if maintainers prefer.

@copy-pr-bot

copy-pr-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@AcidLeroy
AcidLeroy force-pushed the fail-on-uncordon-error branch from 6f1ee1c to 44fed9f Compare July 13, 2026 23:16
@AcidLeroy

Copy link
Copy Markdown
Author

@tariq1890 Do I need to mention this in an office hours or something? Happy to discuss the direction/motivation here.

@tariq1890

Copy link
Copy Markdown
Contributor

Thank you for your PR. We are in somewhat of a code freeze as we have a new planned release coming up. I will need to discuss with the rest of the team if we are to include this change in the next release.

Comment thread cmd/driver-manager/main.go Outdated
Comment thread internal/kubernetes/client_test.go Outdated
@AcidLeroy

Copy link
Copy Markdown
Author

Thank you for your PR. We are in somewhat of a code freeze as we have a new planned release coming up. I will need to discuss with the rest of the team if we are to include this change in the next release.

Thanks @tariq1890! This was just a weirdness that we noticed as our clusters come up for the first time (api server might not be fully ready). It's not too much of an issue during steady state or upgrades. Happy to discuss other ways to handle this as well if this doesn't work for you.

A failed uncordon after driver work was logged with Warnf and swallowed,
so the init container exited 0 while the node stayed Ready,SchedulingDisabled
with no controller to reconcile it.

Retry the uncordon with a bounded exponential backoff (5 attempts) and
propagate the error on the main uninstall path so the container exits
non-zero once the budget is exhausted. The cleanupOnFailure path stays
best-effort. RetryBackoff is shared with UpdateNodeLabels so the retry
policy has a single home.

Fixes NVIDIA#190.

Signed-off-by: Cody W. Eilar <cody.eilar@omniva.com>
@AcidLeroy
AcidLeroy force-pushed the fail-on-uncordon-error branch from 44fed9f to 9800a7e Compare July 20, 2026 16:54
@AcidLeroy

Copy link
Copy Markdown
Author

@tariq1890 any updates on getting this in?

@tariq1890

Copy link
Copy Markdown
Contributor

@AcidLeroy Apologies for the delayed responses. We are in a code-freeze right now as we are working on getting the next release of the gpu-operator out. Once that's done, we can get back to reviewing this PR. Should this PR be merged, it will be in the releases of gpu-operator following the next.

kvalliyurnatt
kvalliyurnatt previously approved these changes Aug 26, 2026
@kvalliyurnatt

Copy link
Copy Markdown
Contributor

/ok to test 9800a7e

@kvalliyurnatt

kvalliyurnatt commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

@AcidLeroy regarding

the symmetric CordonNode still aborts on the first transient error (unchanged here) — only a failed uncordon leaves the node stuck Ready,SchedulingDisabled. Happy to extend the same retry to cordon in a follow-up if maintainers prefer.

could you include this in the existing PR, I think that would be a good to have as well.

Also could you update the PR description, it seems outdated

@kvalliyurnatt
kvalliyurnatt dismissed their stale review August 28, 2026 14:00

I think we can include the retries for cordon as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: k8s-driver-manager exits 0 when post-driver uncordon fails, leaving node Ready,SchedulingDisabled

3 participants