feat: force sync route after sandbox resume#52
Conversation
|
@PersistentJZH func (m *SandboxManager) PauseSandbox(ctx context.Context, sbx infra.Sandbox) error {
sbx.Pause(ctx)
m.proxy.SyncRouteWithPeers(sbx.GetRoute())
}And just replace the direct calls to sbx.Pause/Resume in the e2b controller. |
a01bc96 to
eef377c
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #52 +/- ##
==========================================
+ Coverage 45.71% 45.89% +0.17%
==========================================
Files 75 75
Lines 4379 4410 +31
==========================================
+ Hits 2002 2024 +22
- Misses 2188 2193 +5
- Partials 189 193 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
eef377c to
006937a
Compare
Signed-off-by: PersistentJZH <zhihao.kan17@gmail.com> - Add PauseSandbox and ResumeSandbox methods to SandboxManager - Replace direct sbx.Pause/Resume calls in e2b controller with SandboxManager methods - Add InplaceRefresh before route sync to ensure latest PodIP and State
006937a to
eb14cb6
Compare
thanks @AiRanthem, pls help to review again |
pkg/sandbox-manager/api.go
Outdated
| log.Error(err, "failed to refresh sandbox after resume, route sync may use stale IP") | ||
| // Continue to sync route even if refresh fails, as the route might still be valid | ||
| } | ||
| start := time.Now() |
There was a problem hiding this comment.
The synchronous routing code after pause and resume looks somewhat repetitive. Could we consider extracting it into a common function?
…cessary deepcopy Signed-off-by: PersistentJZH <zhihao.kan17@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: furykerry The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Ⅰ. Describe what this PR does
Add force route synchronization in sandbox-manager after resuming sandbox to ensure all peer instances are aware of route changes (especially PodIP) without waiting for informer watch events.
Changes:
Ⅱ. Does this pull request fix one issue?
#35
Ⅲ. Describe how to verify it
Ⅳ. Special notes for reviews