Skip to content

Conversation

@neelkanth-kaushik
Copy link
Contributor

Added proactive size checks so the SDK avoids queuing events that would push the on-disk queue file above 512 KB. When a new event would exceed the limit, the plugin attempts an immediate flush instead of silently trimming. Keep a safe trimming/fallback path on write failures or unexpected edge cases.

buffer = utf8.encode(serialized);

// If still too big after trimming to target, write empty queue as last resort
if (buffer.length > _kMaxQueueBytes) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good, just want double check with @bsneed on this logic to empty the queue. Max individual event size is 32k if I remember correctly which is less than the difference in max size and the 475k target, so this seems ok to me as a probably-never-happen last ditch case.

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.

3 participants