Skip to content

fix(runtime): honor refresh and retry before process start - #903

Open
RedZapdos123 wants to merge 1 commit into
openkruise:masterfrom
RedZapdos123:fix-runtime-process-refresh-retry
Open

fix(runtime): honor refresh and retry before process start#903
RedZapdos123 wants to merge 1 commit into
openkruise:masterfrom
RedZapdos123:fix-runtime-process-refresh-retry

Conversation

@RedZapdos123

Copy link
Copy Markdown
Contributor

Description:

Honor runtime refresh and retry before starting process streams.

Before this change, ProcessAPI.Run resolved transport once from the bound sandbox and called client.Start directly. As a result, a caller-provided WithRefresh hook could not surface a newly stamped runtime URL or TLS transport, and transient start failures ignored the configured WithRetry policy.

This PR keeps the existing process behavior after stream startup, but retries only the pre-first-event startup path against refreshed sandbox snapshots. It also adds regression tests for the missing-runtime-URL refresh path and a transient CodeUnavailable start failure.

Validation Tests run:

  • go test ./pkg/utils/runtime -run 'TestRunCommandWithRuntime_RefreshResolvesRuntimeURL|TestRunCommandWithRuntime_RetriesTransientStartError' -count=1 -v
  • go test ./pkg/utils/runtime -run 'TestRunCommandWithRuntime|TestDoCSIMount|TestChmodFileOnRuntime' -count=1

Notes:

  • Scope is intentionally limited to ProcessAPI.Run.
  • No existing issue is linked; this is a direct bugfix PR.
  • Retry stays limited to the pre-start path; once the process stream has started, the call is not replayed.

Signed-off-by: Mridankan Mandal <xerontitan90@gmail.com>
@kruise-bot
kruise-bot requested review from furykerry and zmberg August 31, 2026 05:48
@kruise-bot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zmberg for approval by writing /assign @zmberg in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.51%. Comparing base (815a36d) to head (1b53883).

Files with missing lines Patch % Lines
pkg/utils/runtime/process.go 90.00% 5 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #903      +/-   ##
==========================================
+ Coverage   82.49%   82.51%   +0.01%     
==========================================
  Files         254      254              
  Lines       21585    21625      +40     
==========================================
+ Hits        17806    17843      +37     
- Misses       3080     3082       +2     
- Partials      699      700       +1     
Flag Coverage Δ
unittests 82.51% <90.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants