-
Notifications
You must be signed in to change notification settings - Fork 16
fix: retry upload order #259
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
Conversation
bc600a7
to
5fcee0a
Compare
43e7f7d
to
6ec357a
Compare
bfad97e
to
3e3ad04
Compare
3e3ad04
to
e893149
Compare
core/src/main/java/com/amplitude/core/platform/EventPipeline.kt
Outdated
Show resolved
Hide resolved
e893149
to
a34ce24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a bit overcomplicated logic with a bug in reset.
a34ce24
to
498a4f0
Compare
63c8002
to
1cc8aa1
Compare
core/src/test/kotlin/com/amplitude/core/platform/EventPipelineTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@polbins resolve comments and let's merge
…iled - this new logic will respect the order of files as it will always get the next file that we need to upload
- uses ExponentialBackoffRetryHandler to handle most of the logic
This reverts commit 8a4defe.
a9a46ac
to
445aadb
Compare
🎉 This PR is included in version 1.20.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Summary
After removal of the old retry logic in #258, we're now re-introducing an updated version of retrying in this PR.
We have an updated
AnalyticsResponse
with a flag to retry when upload failed. The premise is that we will retry when the event file is still present, and won't retry if it's not (e.g. bad event file).After knowing the result of the response, we'll now retry within the
EventPipeline
itself through the use ofExponentialBackoffRetryHandler
. This class contains the logic for exponential back-off delay that happens every retry attempt.We've also updated how we're reading the event file from storage. We'll get the sorted event files again, whenever we're retrying.
Checklist