Skip to content

fix(okta): retry transient errors once on the pooled client path#547

Merged
somethingnew2-0 merged 1 commit into
mainfrom
pcollins/okta-transient-retry
Jul 16, 2026
Merged

fix(okta): retry transient errors once on the pooled client path#547
somethingnew2-0 merged 1 commit into
mainfrom
pcollins/okta-transient-retry

Conversation

@somethingnew2-0

Copy link
Copy Markdown
Collaborator

What & why

A pooled Okta client reuses one long-lived aiohttp session across a run. Keep-alive connections it holds can be closed server-side by Okta's load balancer during idle gaps; reusing a dead one raises a transient failure (a ServerDisconnectedError, which the SDK surfaces as a null-response error). The SDK does not retry these itself — it bails immediately on a null response and only retries HTTP statuses, not connection-launch failures.

This retries a call that raises OktaTransientError once, rebuilding the coroutine each attempt. An immediate retry gets a fresh connection and usually succeeds, so a transient blip recovers within the run instead of skipping the resource until the next reconcile. It is bounded to a single retry so a genuinely-degraded endpoint — or a lingering 429 — still gives up quickly rather than amplifying load.

Composes with #546: that PR reclassifies the SDK's null-response AttributeError as OktaTransientError, which is exactly what this retry catches for the connection-reuse case. Independently, this also retries returned 5xx/timeout transients.

🤖 Generated with Claude Code

The run-lifetime pooled aiohttp session the syncer uses reuses keep-alive
connections Okta can close server-side; reusing a dead one raises a
transient error the SDK does not retry itself (it bails immediately on a
null response and only retries HTTP statuses). Retry a call that raises
OktaTransientError once in _WrapperClient — an immediate retry gets a
fresh connection and recovers within the run instead of skipping the
resource until the next reconcile. Bounded to one retry so a degraded
endpoint or a lingering 429 still gives up quickly.

Composes with the None-response AttributeError reclassification in #546,
which surfaces that specific transport failure as OktaTransientError for
this retry to catch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@somethingnew2-0
somethingnew2-0 force-pushed the pcollins/okta-transient-retry branch from ba0053e to 57e9a62 Compare July 16, 2026 23:03
@somethingnew2-0
somethingnew2-0 enabled auto-merge (squash) July 16, 2026 23:06
@somethingnew2-0
somethingnew2-0 merged commit 6ff1adc into main Jul 16, 2026
6 checks passed
@somethingnew2-0
somethingnew2-0 deleted the pcollins/okta-transient-retry branch July 16, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants