From 37f965b9747fd00ba4f3b01be378279bb6704687 Mon Sep 17 00:00:00 2001 From: Oleksandr <1931331+olksdr@users.noreply.github.com> Date: Mon, 16 Jan 2023 10:46:41 +0100 Subject: [PATCH] Revert "feat(replays): Enable PII scrubbing for all organizations" (#1747) Reverts getsentry/relay#1678 This is the suspected change increased the event's processing time. And maybe introduced a memory leak. --- relay-server/src/actors/processor.rs | 2 +- tests/integration/test_replay_recordings.py | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/relay-server/src/actors/processor.rs b/relay-server/src/actors/processor.rs index 9e5a99dc64..573bc19b6f 100644 --- a/relay-server/src/actors/processor.rs +++ b/relay-server/src/actors/processor.rs @@ -1087,7 +1087,7 @@ impl EnvelopeProcessorService { ItemType::ReplayRecording => { // XXX: Temporarily, only the Sentry org will be allowed to parse replays while // we measure the impact of this change. - if replays_enabled { + if replays_enabled && state.project_state.organization_id == Some(1) { // Limit expansion of recordings to the max replay size. The payload is // decompressed temporarily and then immediately re-compressed. However, to // limit memory pressure, we use the replay limit as a good overall limit for diff --git a/tests/integration/test_replay_recordings.py b/tests/integration/test_replay_recordings.py index 72c6f4775b..3aca9ebc68 100644 --- a/tests/integration/test_replay_recordings.py +++ b/tests/integration/test_replay_recordings.py @@ -1,4 +1,4 @@ -import zlib +import time from sentry_sdk.envelope import Envelope, Item, PayloadRef @@ -92,6 +92,8 @@ def test_chunked_replay_recordings_processing( assert replay_recording["received"] assert type(replay_recording["received"]) == int + outcomes_consumer.assert_empty() + def test_nonchunked_replay_recordings_processing( mini_sentry, relay_with_processing, replay_recordings_consumer, outcomes_consumer @@ -115,8 +117,7 @@ def test_nonchunked_replay_recordings_processing( ["attachment_type", "replay_recording"], ] ) - payload = recording_payload(b"[]") - envelope.add_item(Item(payload=PayloadRef(bytes=payload), type="replay_recording")) + envelope.add_item(Item(payload=PayloadRef(bytes=b"test"), type="replay_recording")) relay.send_envelope(project_id, envelope) @@ -128,12 +129,7 @@ def test_nonchunked_replay_recordings_processing( assert replay_recording["org_id"] == org_id assert type(replay_recording["received"]) == int assert replay_recording["retention_days"] == 90 - assert replay_recording["payload"] == payload + assert replay_recording["payload"] == b"test" assert replay_recording["type"] == "replay_recording_not_chunked" outcomes_consumer.assert_empty() - - -def recording_payload(bits: bytes): - compressed_payload = zlib.compress(bits) - return b'{"segment_id": 0}\n' + compressed_payload