← Back to Pull requests

fix(remotegpu): preserve reservations during Bind retries #3610

Closed
unknown closed this pull request without merging on Dec 03, 2026 18:09 UTC
View on GitHub
unknown unknown commented on Dec 02, 2026 14:47 UTC
Author

What type of PR is this?

/kind bug

What this PR does / why we need it:

RemoteGPU reservations are prematurely released during intermediate node-lock rollback in Bind, causing subsequent retries to lose the reservation.

This PR:

1. Makes RemoteGPU ReleaseNodeLock a no-op because RemoteGPU does not acquire a node lock.
2. Preserves RemoteGPU reservations during Bind retries and explicitly releases the booking on final failure.
3. Preserves reservation cleanup when Filter fails to patch Pod annotations.
4. Adds regression tests for Bind lock retries and final failure cleanup.

Which issue(s) this PR fixes:

Fixes #3608

Special notes for your reviewer:

Following up on #3399, I reproduced the issue using deterministic lock contention and synthetic RemoteGPU inventory against a real Kind cluster (Kubernetes v1.37.0).

| Measurement | Before | After |
| --- | --- | --- |
| Lock attempts per run | 9 | 9 |
| Intermediate retries per run | 8 | 8 |
| Reservations preserved during retry | 0/4 | 4/4 |

The revised implementation releases the booking once on final Bind failure. GPU capacity and the Lupine endpoint are reusable after cleanup.

The existing ResourceVersion: "0" behavior remains unchanged.

As requested during review, TTL pinning, concurrent Bind protection, and leadership checks have been removed from this PR. TTL pinning will be addressed separately with its own reproduction.

AI disclosure: This PR used AI for understanding the code, optimizing code quality and writing tests.

Does this PR introduce a user-facing change?:

``release-note
Fix RemoteGPU reservation loss during Bind lock retries.
``

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->

Summary by CodeRabbit

Bug Fixes
Remote GPU reservations are now retained during node-lock release and cleared through the reservation cleanup step.
Reservations are released when scheduling or binding fails, helping ensure GPU endpoints become available for later pods.
Reservations remain intact when a bind attempt succeeds after a temporary lock conflict.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 283 lines (+212 / -71) across 3 files Reviewer: moezdil Review duration: 1642m
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 283 lines diff across 3 files
0.40
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.338
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3610"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.7% (MEDIUM) · Higher = larger blast radius
39.7%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.7% · Safe to merge
15.7%