Skip to content

Limit beats packet compressed and decompressed sizes#26141

Open
kroepke wants to merge 2 commits into
limit-beats-decodingfrom
limit-beats-decompress
Open

Limit beats packet compressed and decompressed sizes#26141
kroepke wants to merge 2 commits into
limit-beats-decodingfrom
limit-beats-decompress

Conversation

@kroepke
Copy link
Copy Markdown
Member

@kroepke kroepke commented May 27, 2026

Description

When dealing with compressed beats payloads, we haven't limited their size.
Now we have individual limits for the sizes of the compressed and decompressed payload buffers.

For the decompressed buffer we now also avoid an unnecessary copy and check for exceeding the configured limit during decompression, which can help avoiding pathological decompression bombs.

Motivation and Context

Without limits and due to eager allocation it was possible to exhaust the available memory.
The defaults should be sensible for running with default beats batch sizes, but they are configurable per input in case users need higher limits (at the expense of more memory usage).

How Has This Been Tested?

Unit tests.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have requested a documentation update.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

…igured maximums

avoid allocating/copying the entire buffer after decompression so we can check for pathological payloads
that would consume way too much memory

both limits are configurable per input, so that if the defaults are too small for a specific user, they can
override
@kroepke kroepke requested a review from a team May 27, 2026 15:27
@kroepke
Copy link
Copy Markdown
Member Author

kroepke commented May 27, 2026

Currently based on #26139

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.

1 participant