[coordinator] retry transient snowflake errors - #448
Conversation
📝 WalkthroughWalkthroughChangesSnowflake ID generation now validates HTTP statuses, classifies retryable failures, applies bounded exponential backoff, and includes tests for transient errors, transport disconnects, permanent client errors, and retry exhaustion. Snowflake ID retry handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant SnowflakeClient
participant generate_id_once
participant SnowflakeEndpoint
SnowflakeClient->>generate_id_once: Request ID
generate_id_once->>SnowflakeEndpoint: Send HTTP request
SnowflakeEndpoint-->>generate_id_once: Return response or disconnect
generate_id_once-->>SnowflakeClient: Return ID or error
SnowflakeClient->>SnowflakeClient: Classify error and apply backoff
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@osprey_coordinator/src/snowflake_client.rs`:
- Around line 36-38: Update retry_delay to implement exponential backoff: for
successive attempts, produce 50/100/200 ms using RETRY_BASE_DELAY_MILLIS, rather
than multiplying by (attempt + 1) squared. Preserve the existing Duration return
type and attempt-based retry sequencing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 3c8265e9-9f45-48e6-b17b-5a0cce96d45d
📒 Files selected for processing (1)
osprey_coordinator/src/snowflake_client.rs
we should retry transient snowflake generation failures with backoff (i.e. ratelimited, 5xx), while failing permanent errors immediately (i.e. bad request)
Summary by CodeRabbit