Skip to content

Add explicit context checking for belt-and-suspenders safety in tenant isolation policy polling #801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 14 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/unreleased/fixed-20250603-130329.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: fixed
body: Add explicit context checking for belt-and-suspenders safety in tenant isolation policy polling
time: 2025-06-03T13:03:29.272364174Z
custom:
Issue: "800"
Original file line number Diff line number Diff line change
@@ -144,7 +144,8 @@ func getRetryAfterDuration(resp *http.Response) time.Duration {
// doWaitForLifecycleOperationStatus polls an asynchronous operation until completion.
// It follows the location header from the initial response, respects Retry-After
// headers to control polling frequency, and implements exponential backoff with
// minimum 2s and maximum 60s between attempts.
// minimum 2s and maximum 60s between attempts. The function respects context
// cancellation during sleep periods between polling attempts.
//
// Parameters:
// - ctx: Context for the request with cancellation and timeout capabilities
@@ -186,7 +187,6 @@ func (client *Client) doWaitForLifecycleOperationStatus(ctx context.Context, res

tflog.Debug(ctx, fmt.Sprintf("Waiting for %s before polling again", waitTime))

// Wait before polling again
err = client.Api.SleepWithContext(ctx, waitTime)
if err != nil {
return nil, fmt.Errorf("polling interrupted: %w", err)