-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix: Rely on on task completion vs http completion to end tasks #134
Merged
Conversation
This file contains 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
60f5643
to
d4a65e1
Compare
izaaz
reviewed
Mar 14, 2024
izaaz
reviewed
Mar 14, 2024
justin-fiedler
approved these changes
Mar 14, 2024
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.
Awesome. Changes look good. Thank you @crleona
I reset my review to wait for tests.
c387cc3
to
32f6921
Compare
@justin-fiedler @izaaz tests added, please take a look. |
justin-fiedler
approved these changes
Mar 15, 2024
izaaz
reviewed
Mar 15, 2024
32f6921
to
2cb9c97
Compare
izaaz
approved these changes
Mar 15, 2024
github-actions bot
pushed a commit
that referenced
this pull request
Mar 19, 2024
## [1.4.1](v1.4.0...v1.4.1) (2024-03-19) ### Bug Fixes * Rely on on task completion vs http completion to end tasks ([#134](#134)) ([b17e704](b17e704))
🎉 This PR is included in version 1.4.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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
EventPipeline previously cleared out tasks based on whether the http request was still in progress, not whether the request had fully completed and we had cleaned up the previous eventBlock. This means that a flush that was called after all requests had completed but before they were processed would re-upload previously uploaded events, as their backing files still exists.
Now, we track upload tasks more granularly by eventBlock URL, and clear them only when processing is complete, which guarantees that an eventBlock is only uploaded once (per amplitude instance, at least).
There is a change in behavior of how we upload with this change: instead of waiting for all requests to complete before starting a new batch, we will immediately start to upload any new eventBlocks on every flush, regardless of how many requests are already in progress. I think this would be the more expected behavior, but it should also be pretty easy to change back.
Checklist