Repository navigation
fix(replays): Bound recording uncompressed size without scrubbing - #6587
Open
sentry-junior[bot] wants to merge 7 commits into
Open
sentry-junior[bot] wants to merge 7 commits into
sentry-junior[bot] wants to merge 7 commits into
Conversation
Recording scrubbing already enforces max_replay_uncompressed_size, but only for projects that scrub recordings. Check the inflated size of every recording in processing Relays so the limit applies regardless. Refs REPLAY-994 Co-Authored-By: Dominik Buszowiecki <44422760+DominikB2014@users.noreply.github.com>
Co-Authored-By: Dominik Buszowiecki <44422760+DominikB2014@users.noreply.github.com>
Contributor
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit db985d1. Configure here.
…replay-994-bound-recording-uncompressed-size
vjeranc
requested changes
Nov 3, 2026
Move the size check out of validation, which ran before filtering and quotas, into the recording scrubbing step. Scrubbing now reports an explicit TooLarge error from its own decompression, and processing Relays without recording scrubbing run the same decompression helper to check the size, so each recording is decompressed at most once.
…replay-994-bound-recording-uncompressed-size # Conflicts: # CHANGELOG.md
vjeranc
reviewed
Nov 3, 2026
Rename validate_recording to check_recording_size and document that callers may pass malformed recordings through, and rename scrub_recordings to process_recordings since it also enforces the size limit without scrubbing. Add integration tests for processing Relays without recording scrubbing and without a PII config, covering recordings at and over max_replay_uncompressed_size.
This branch has not been deployed
This file contains hidden or 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
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.
Companion to getsentry/sentry#129541.
Relay already caps a replay recording at
max_replay_uncompressed_size(100 MiB by default) once it is decompressed, but only insideRecordingScrubber. That code runs only for projects that have recording scrubbing turned on and a non-empty PII config. For every other project, only the 10 MiB compressed limit is checked, so a small zlib payload can be stored that inflates to any size every time it is read.The check now lives in the recording scrubbing step, which runs after filtering and quotas, so each recording is decompressed at most once:
ParseRecordingError::TooLarge, instead of truncating and failing on JSON parsing. That maps toTooLarge, which records anItemTooLarge(ReplayRecording)outcome instead ofInvalidReplayRecordingEvent.relay_replays::recording::validate_recording. It uses the same header split and decompression helper as the scrubber, but inflates into a sink, so it never buffers the output. OnlyTooLargeis rejected there. Other malformed recordings, including bodies that are not valid zlib, are left to the consumer as before. Uncompressed JSON bodies are not checked.TooLargeloses itsprocessingcfg gate because scrubbing can now return it in both configurations.Refs REPLAY-994
via @DominikB2014.
--
View Session [Sentry]