fix: add retry/backoff to inbound email listener for transient failures#234
Draft
bukinoshita wants to merge 3 commits intomainfrom
Draft
fix: add retry/backoff to inbound email listener for transient failures#234bukinoshita wants to merge 3 commits intomainfrom
bukinoshita wants to merge 3 commits intomainfrom
Conversation
Member
Author
|
@cursor can you fix conflicts |
|
The PR description was updated by cubic (automated). No human edits to preserve beyond that. The conflicts are resolved and the PR is up to date. Conflicts resolved. I rebased the branch onto the latest |
Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
…ience Wrap all SDK calls in retryPoll() which retries rate_limit_exceeded errors using Retry-After headers and exponential backoff, and retries transient network errors. Only increment consecutiveErrors after retries are exhausted, preventing premature exits on temporary API/network issues. Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
1d1d104 to
09e06a3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary by cubic
Adds retry/backoff to the inbound email listener to handle transient 429 and network errors so it keeps running without dropping emails. Fixes Linear BU-637 by using shared retry logic and counting failures only after retries are exhausted.
retryPollfor poll loops: retriesrate_limit_exceededup to 3 times (usesRetry-Afteror 1s/2s/4s), retries thrown network errors, and returns a simple result object.emails receiving listento useretryPollfor initial connect and polling; only incrementsconsecutiveErrorsafter retries; exits after 5 real failures; preserves order with[...newEmails].reverse().retryPoll(success, rate limit, retry-after, thrown errors, exhaustion) and updated listen tests toit().Written for commit 1d1d104. Summary will update on new commits.