Skip to content

feature(sandbox-manager): refine paused retention timeout handling#566

Open
AiRanthem wants to merge 7 commits into
openkruise:masterfrom
AiRanthem:feature/set-pause-timeout-260610
Open

feature(sandbox-manager): refine paused retention timeout handling#566
AiRanthem wants to merge 7 commits into
openkruise:masterfrom
AiRanthem:feature/set-pause-timeout-260610

Conversation

@AiRanthem

Copy link
Copy Markdown
Member

Summary

  • Compute create-time auto-pause retention from the persisted reserve-paused value instead of storing a parsed duration on request extensions.
  • Split timeout math into a pure helper so resume placeholder calculation has no annotation side effects.
  • Update E2B tests around resume placeholder/default retention behavior.

Test Plan

  • GOCACHE=/private/tmp/go-build-cache go test ./pkg/pausedretention
  • GOCACHE=/private/tmp/go-build-cache go test ./pkg/controller/sandbox -run 'TestSandboxReconciler_(HandleShutdownTimeout|HandlePauseTimeout|AutoPauseReservePausedRetention)'\n- GOCACHE=/private/tmp/go-build-cache go test ./pkg/servers/e2b/models\n- GOCACHE=/private/tmp/go-build-cache go test ./pkg/servers/e2b -run 'Test.*(Resume|Pause|Timeout|ReservePaused)'\n- git diff --check

@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

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
Add paused retention timeout helpers, parse the E2B extension, and persist accepted paused retention values through sandbox-manager mutations.

Apply the retention setting during E2B create, manual pause, auto-pause timeout writes, and controller-driven sandbox auto-pause recalculation. Fold in the explicit infra timeout-policy boundary and the controller annotation-parser reuse so the final review diff reflects the intended API shape.

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
@AiRanthem AiRanthem force-pushed the feature/set-pause-timeout-260610 branch from 0d391de to 5056d57 Compare June 24, 2026 03:27
@AiRanthem AiRanthem changed the title Refine paused retention timeout handling feature(sandbox-manager): refine paused retention timeout handling Jun 24, 2026
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.35450% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.97%. Comparing base (ce4b897) to head (4cfd619).
⚠️ Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
pkg/controller/sandbox/sandbox_controller.go 96.61% 2 Missing ⚠️
pkg/pausedretention/retention.go 90.47% 1 Missing and 1 partial ⚠️
pkg/servers/e2b/timeout.go 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #566      +/-   ##
==========================================
+ Coverage   79.71%   79.97%   +0.25%     
==========================================
  Files         195      203       +8     
  Lines       14107    14814     +707     
==========================================
+ Hits        11246    11848     +602     
- Misses       2457     2541      +84     
- Partials      404      425      +21     
Flag Coverage Δ
unittests 79.97% <97.35%> (+0.25%) ⬆️

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.

Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
Signed-off-by: AiRanthem <zhongtianyun.zty@alibaba-inc.com>
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