Skip to content
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

Flush keepalive batches past keepalive limit #1100

Merged
merged 3 commits into from
Jul 10, 2024
Merged

Conversation

danieljackins
Copy link
Contributor

This PR immediately sends any batches that are over the 64 KB limit when the keepalive option is turned on to help prevent any data loss.

  • I've included a changeset (psst. run yarn changeset. Read about changesets here).

Copy link

changeset-bot bot commented Jul 2, 2024

🦋 Changeset detected

Latest commit: e6cba11

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@segment/analytics-next Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

* going over this to prevent data loss.
*/
function passedKeepaliveLimit(buffer: unknown): boolean {
return kilobytes(buffer) >= 64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add padding, since in practice the max size is the total of all outbound requests with keep-alive, so we are potentially competing with other requests?

@silesky silesky merged commit e60f625 into master Jul 10, 2024
5 checks passed
@silesky silesky deleted the batched-keepalive branch July 10, 2024 18:29
@github-actions github-actions bot mentioned this pull request Jul 10, 2024
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