Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(replay): cap rasterizer input size and quarantine worker-killers (#89010)

Tue Haulund7e32cca8e92f
diff --git a/nodejs/src/session-replay/recording-rasterizer/__tests__/block-proxy.test.ts b/nodejs/src/session-replay/recording-rasterizer/__tests__/block-proxy.test.ts
index 1a7c9884f2e5..c99269ae9cd5 100644
--- a/nodejs/src/session-replay/recording-rasterizer/__tests__/block-proxy.test.ts
+++ b/nodejs/src/session-replay/recording-rasterizer/__tests__/block-proxy.test.ts
@@ -53,6 +53,9 @@ describe('BlockProxy', () => {
expect(count).toBe(2)
expect(proxy.blockCount).toBe(2)
+ // Inclusive ranges: 1001 + 2001, not 1000 + 2000. Undercounting lets a recording at the
+ // size cap through by one byte per block.
+ expect(proxy.totalCompressedBytes).toBe(3002)
expect(mockInternalFetch).toHaveBeenCalledWith(
'http://localhost:6738/api/projects/1/recordings/test-session-123/blocks',
{ headers: { 'X-Internal-Api-Secret': 'test-secret' } }
diff --git a/nodejs/src/session-replay/recording-rasterizer/__tests__/recorder.test.ts b/nodejs/src/session-replay/recording-rasterizer/__tests__/recorder.test.ts
index 6649852a0d40..95da63e8deae 100644
--- a/nodejs/src/session-replay/recording-rasterizer/__tests__/recorder.test.ts
+++ b/nodejs/src/session-replay/recording-rasterizer/__tests__/recorder.test.ts
@@ -54,6 +54,7 @@ const cfg = {
recordingApiSecret: 'secret',
screenshotFormat: 'jpeg' as const,
screenshotJpegQuality: 80,
+ maxRecordingCompressedBytes: 512 * 1024 * 1024,
} as any
describe('rasterizeRecording', () => {
@@ -71,6 +72,11 @@ describe('rasterizeRecording', () => {
mockedCapturePage.prepare = jest.fn().mockResolvedValue(mockCapturePage)
mockedBlockProxy.prototype.fetchBlocks = jest.fn().mockResolvedValue(3)
+ // The automock drops the getter, and `undefined > cap` would silently disable the size gate.
+ Object.defineProperty(mockedBlockProxy.prototype, 'totalCompressedBytes', {
+ get: () => 1024,
+ configurable: true,
+ })
mockPlayer = {
load: jest.fn().mockResolvedValue(undefined),
@@ -114,6 +120,20 @@ describe('rasterizeRecording', () => {
expect(callOrder).toEqual(['getPage', 'prepare', 'fetchBlocks', 'load', 'waitForStart', 'capturePlayback'])
})
+ it('fails permanently before loading when the listing exceeds the byte cap', async () => {
+ Object.defineProperty(mockedBlockProxy.prototype, 'totalCompressedBytes', {
+ get: () => cfg.maxRecordingCompressedBytes + 1,
+ configurable: true,
+ })
+
+ await expect(
+ rasterizeRecording(mockPool, baseInput(), '/tmp/out.mp4', '<html></html>', jest.fn(), { cfg })
+ ).rejects.toMatchObject({ code: 'RECORDING_TOO_LARGE', retryable: false })
+
+ expect(mockPlayer.load).not.toHaveBeenCalled()
+ expect(mockPool.releasePage).toHaveBeenCalledWith(mockPage)
+ })
+
it('releases page and disposes player on success', async () => {
await rasterizeRecording(mockPool, baseInput(), '/tmp/out.mp4', '<html></html>', jest.fn(), { cfg })
diff --git a/nodejs/src/session-replay/recording-rasterizer/capture/block-proxy.ts b/nodejs/src/session-replay/recording-rasterizer/capture/block-proxy.ts
index 707c5e619775..8b2dcdddf1cf 100644
--- a/nodejs/src/session-replay/recording-rasterizer/capture/block-proxy.ts
+++ b/nodejs/src/session-replay/recording-rasterizer/capture/block-proxy.ts
@@ -27,6 +27,12 @@ export class BlockProxy {
return this.blocks.length
}
+ // Compressed bytes the render will download, known before anything loads into the browser.
+ // S3 Range bytes=start-end is inclusive, so each block spans end - start + 1 bytes.
+ get totalCompressedBytes(): number {
+ return this.blocks.reduce((sum, block) => sum + (block.end_byte - block.start_byte + 1), 0)
+ }
+
// Send both the legacy shared secret (when configured) and the relayed team-scoped JWT (when one
// was minted upstream), so recording-api accepts either and rollout stays order-independent.
private authHeaders(): Record<string, string> {
diff --git a/nodejs/src/session-replay/recording-rasterizer/capture/recorder.ts b/nodejs/src/session-replay/recording-rasterizer/capture/recorder.ts
index 58c0e6f0e761..20515a30dd6d 100644
--- a/nodejs/src/session-replay/recording-rasterizer/capture/recorder.ts
+++ b/nodejs/src/session-replay/recording-rasterizer/capture/recorder.ts
@@ -1,6 +1,7 @@
import type { InactivityPeriod } from '@posthog/replay-headless/protocol'
import { config as defaultConfig } from '~/session-replay/recording-rasterizer/config'
+import { RasterizationError } from '~/session-replay/recording-rasterizer/errors'
import { type Logger, createLogger } from '~/session-replay/recording-rasterizer/logger'
import {
RasterizationProgress,
@@ -100,7 +101,21 @@ export async function rasterizeRecording(
const blockProxy = new BlockProxy(cfg, log)
const blockCount = await blockProxy.fetchBlocks(input)
- log.info({ blockCount }, 'block listing fetched')
+ const compressedBytes = blockProxy.totalCompressedBytes
+ log.info({ blockCount, compressedBytes }, 'block listing fetched')
+ if (!Number.isFinite(compressedBytes)) {
+ // A malformed listing yields NaN, and NaN > cap is false: the gate would switch off
+ // silently. Fail open, but visibly.
+ log.warn({ blockCount }, 'block listing has non-numeric byte ranges; size gate skipped')
+ } else if (compressedBytes > cfg.maxRecordingCompressedBytes) {
+ // Fail permanently before loading: oversized recordings run the pod into its memory
+ // limit, and the kernel kill takes the healthy renders on the pod down with it.
+ throw new RasterizationError(
+ `Recording too large to render: ${compressedBytes} compressed bytes in ${blockCount} blocks (limit ${cfg.maxRecordingCompressedBytes})`,
+ false,
+ 'RECORDING_TOO_LARGE'
+ )
+ }
const playerConfig = buildPlayerConfig(input, captureConfig.playbackSpeed, blockCount)
player = new PlayerController(capturePage, blockProxy, onProgress, log)
diff --git a/nodejs/src/session-replay/recording-rasterizer/config.ts b/nodejs/src/session-replay/recording-rasterizer/config.ts
index b59ff2839c3b..e541043907ae 100644
--- a/nodejs/src/session-replay/recording-rasterizer/config.ts
+++ b/nodejs/src/session-replay/recording-rasterizer/config.ts
@@ -49,6 +49,9 @@ export const config = {
// Recording API. The dev recording-api listens on 6741 (bin/temporal-recording-rasterizer-worker).
recordingApiBaseUrl: process.env.RECORDING_API_BASE_URL || 'http://localhost:6741',
recordingApiSecret: process.env.INTERNAL_API_SECRET || '',
+ // Renders above this many compressed bytes fail permanently instead of loading the pod into its
+ // memory limit. Deliberately generous: the every-render byte log is what tightens it over time.
+ maxRecordingCompressedBytes: parsePositiveInt(process.env.MAX_RECORDING_COMPRESSED_BYTES, 512 * 1024 * 1024),
// Player
siteUrl: process.env.SITE_URL || 'http://localhost:8000',
diff --git a/nodejs/src/session-replay/recording-rasterizer/errors.ts b/nodejs/src/session-replay/recording-rasterizer/errors.ts
index 0f9b029c1a7c..8676b2098070 100644
--- a/nodejs/src/session-replay/recording-rasterizer/errors.ts
+++ b/nodejs/src/session-replay/recording-rasterizer/errors.ts
@@ -10,6 +10,7 @@ export const RASTERIZATION_ERROR_CODES = [
'BEGINFRAME_DEADLOCK',
'INVALID_INPUT',
'BLOCK_LISTING_FAILED',
+ 'RECORDING_TOO_LARGE',
'S3_UPLOAD_FAILED',
'S3_UPLOAD_UNDECODABLE_RESPONSE',
'NO_SNAPSHOTS',
diff --git a/posthog/temporal/session_replay/rasterize_recording/activities/stuck_counter.py b/posthog/temporal/session_replay/rasterize_recording/activities/stuck_counter.py
index f1faca29ba44..21c93494ec90 100644
--- a/posthog/temporal/session_replay/rasterize_recording/activities/stuck_counter.py
+++ b/posthog/temporal/session_replay/rasterize_recording/activities/stuck_counter.py
@@ -1,9 +1,9 @@
-from dataclasses import dataclass
from datetime import timedelta
import structlog
from temporalio import activity
+from posthog.dataclasses import frozen
from posthog.redis import get_async_client, get_client
logger = structlog.get_logger(__name__)
@@ -12,30 +12,50 @@ _STUCK_KEY_PREFIX = "replay:rasterize:stuck"
# Each new failure refreshes the TTL, so the window slides on the most recent failure.
STUCK_RASTERIZE_LOOKBACK = timedelta(hours=2)
_STUCK_TTL_SECONDS = int(STUCK_RASTERIZE_LOOKBACK.total_seconds())
+# A worker-killing recording is a property of the recording, not the moment, so its quarantine
+# outlives the sweep cadence instead of expiring before the next dispatch.
+STUCK_RASTERIZE_KILLED_WORKER_LOOKBACK = timedelta(hours=24)
+_KILLED_WORKER_TTL_SECONDS = int(STUCK_RASTERIZE_KILLED_WORKER_LOOKBACK.total_seconds())
+
+
+# A run only bumps the counter after its final scheduled attempt, so 2 means the session has burned
+# through two whole retry envelopes inside the TTL window without a success.
+STUCK_SESSION_THRESHOLD = 2
def _stuck_key(team_id: int, session_id: str) -> str:
return f"{_STUCK_KEY_PREFIX}:{team_id}:{session_id}"
-@dataclass
+@frozen
class BumpStuckCounterInput:
team_id: int
session_id: str
+ # A run whose final failure was a killed worker (heartbeat / start-to-close timeout) quarantines
+ # at once: it already took a pod down, and by the next envelope it will take another.
+ killed_worker: bool = False
@activity.defn
async def bump_stuck_counter_activity(inputs: BumpStuckCounterInput) -> None:
redis_client = get_async_client()
key = _stuck_key(inputs.team_id, inputs.session_id)
+ amount = STUCK_SESSION_THRESHOLD if inputs.killed_worker else 1
+ ttl = _KILLED_WORKER_TTL_SECONDS if inputs.killed_worker else _STUCK_TTL_SECONDS
+ # Never shorten: an ordinary bump landing inside a killed-worker quarantine (an on-demand scan
+ # bypasses the gate) must not downgrade the 24h TTL back to the 2h window.
+ remaining = await redis_client.ttl(key)
+ if remaining is not None and remaining > ttl:
+ ttl = remaining
async with redis_client.pipeline(transaction=False) as pipe:
- pipe.incr(key)
- pipe.expire(key, _STUCK_TTL_SECONDS)
+ pipe.incrby(key, amount)
+ pipe.expire(key, ttl)
await pipe.execute()
logger.info(
"rasterize.stuck_counter_bumped",
team_id=inputs.team_id,
session_id=inputs.session_id,
+ killed_worker=inputs.killed_worker,
)
@@ -47,11 +67,6 @@ async def clear_stuck_counter_activity(inputs: BumpStuckCounterInput) -> None:
await redis_client.delete(key)
-# A run only bumps the counter after its final scheduled attempt, so 2 means the session has burned
-# through two whole retry envelopes inside the TTL window without a success.
-STUCK_SESSION_THRESHOLD = 2
-
-
def read_stuck_session_ids(
team_id: int,
session_ids: list[str],
diff --git a/posthog/temporal/session_replay/rasterize_recording/workflow.py b/posthog/temporal/session_replay/rasterize_recording/workflow.py
index 2b893699d8e6..17a0d1064b2f 100644
--- a/posthog/temporal/session_replay/rasterize_recording/workflow.py
+++ b/posthog/temporal/session_replay/rasterize_recording/workflow.py
@@ -96,12 +96,14 @@ class RasterizeRecordingWorkflow(PostHogWorkflow):
try:
result = await self._run(inputs)
except Exception as exc:
+ # Resolved once so the recorded code and the quarantine decision cannot drift apart.
+ error_code = _resolve_error_code(exc)
# Count runs, not attempts: only the final scheduled attempt is a failed run.
if self._is_final_attempt():
_record_outcome(RASTERIZATION_FAILED_COUNTER, inputs)
if wf.patched(_RECORD_FAILURE_PATCH):
- await self._record_failure(inputs, exc)
- await self._maybe_bump_stuck_counter()
+ await self._record_failure(inputs, exc, error_code)
+ await self._maybe_bump_stuck_counter(error_code)
raise
await self._maybe_clear_stuck_counter()
_record_outcome(RASTERIZATION_COMPLETED_COUNTER, inputs)
@@ -117,7 +119,7 @@ class RasterizeRecordingWorkflow(PostHogWorkflow):
max_attempts = cls._max_attempts()
return max_attempts is not None and 0 < max_attempts <= wf.info().attempt
- async def _record_failure(self, inputs: RasterizeRecordingInputs, exc: BaseException) -> None:
+ async def _record_failure(self, inputs: RasterizeRecordingInputs, exc: BaseException, error_code: str) -> None:
"""Write the renderer's own reason onto the asset before the workflow fails.
Swallows its own errors: losing the reason is worse than the render failing, but masking the
@@ -129,7 +131,7 @@ class RasterizeRecordingWorkflow(PostHogWorkflow):
record_rasterization_failure,
RecordRasterizationFailureInput(
exported_asset_id=inputs.exported_asset_id,
- error_code=_resolve_error_code(exc),
+ error_code=error_code,
error_message=truncate_for_temporal_payload(str(cause), MAX_ERROR_MESSAGE_CHARS),
),
start_to_close_timeout=dt.timedelta(seconds=30),
@@ -138,7 +140,7 @@ class RasterizeRecordingWorkflow(PostHogWorkflow):
except Exception as record_exc:
wf.logger.warning("rasterize.record_failure_failed", extra={"error": str(record_exc)})
- async def _maybe_bump_stuck_counter(self) -> None:
+ async def _maybe_bump_stuck_counter(self, error_code: str) -> None:
info = wf.info()
max_attempts = self._max_attempts()
# Bump only on the final scheduled attempt; recoverable failures would otherwise over-count.
@@ -154,10 +156,15 @@ class RasterizeRecordingWorkflow(PostHogWorkflow):
team_id = info.typed_search_attributes.get(POSTHOG_TEAM_ID_KEY)
if session_id is None or team_id is None:
return
+ # A timeout-class final failure during the render phase means the worker died mid-render
+ # (OOM, wedge): the recording already took a pod down, so it quarantines at once instead of
+ # after a second envelope. The phase guard keeps a timed-out prep or finalize activity (a
+ # Postgres incident, not the recording) on the ordinary two-strike path.
+ killed_worker = error_code == "ACTIVITY_TIMEOUT" and self._phase == "rendering"
try:
await wf.execute_activity(
bump_stuck_counter_activity,
- BumpStuckCounterInput(team_id=team_id, session_id=session_id),
+ BumpStuckCounterInput(team_id=team_id, session_id=session_id, killed_worker=killed_worker),
start_to_close_timeout=dt.timedelta(seconds=10),
retry_policy=common.RetryPolicy(maximum_attempts=2),
)
diff --git a/posthog/temporal/tests/session_replay/rasterize_recording/test_stuck_counter.py b/posthog/temporal/tests/session_replay/rasterize_recording/test_stuck_counter.py
index fe554de1d6ba..ac15ceb48d55 100644
--- a/posthog/temporal/tests/session_replay/rasterize_recording/test_stuck_counter.py
+++ b/posthog/temporal/tests/session_replay/rasterize_recording/test_stuck_counter.py
@@ -1,19 +1,35 @@
import pytest
from unittest.mock import AsyncMock, MagicMock, patch
+from parameterized import parameterized
+
from posthog.temporal.session_replay.rasterize_recording.activities.stuck_counter import (
+ _KILLED_WORKER_TTL_SECONDS,
_STUCK_TTL_SECONDS,
+ STUCK_SESSION_THRESHOLD,
BumpStuckCounterInput,
bump_stuck_counter_activity,
read_stuck_session_ids,
)
+ [
+ # (killed_worker, remaining_ttl, expected_amount, expected_ttl)
+ (False, -2, 1, _STUCK_TTL_SECONDS),
+ (True, -2, STUCK_SESSION_THRESHOLD, _KILLED_WORKER_TTL_SECONDS),
+ # An ordinary bump inside a killed-worker quarantine must not downgrade the longer TTL.
+ (False, _KILLED_WORKER_TTL_SECONDS - 60, 1, _KILLED_WORKER_TTL_SECONDS - 60),
+ ]
+)
@pytest.mark.asyncio
-async def test_bump_stuck_counter_pipelines_incr_and_expire():
+async def test_bump_stuck_counter_pipelines_incrby_and_expire(
+ killed_worker, remaining_ttl, expected_amount, expected_ttl
+):
redis_client = MagicMock()
+ redis_client.ttl = AsyncMock(return_value=remaining_ttl)
pipeline = MagicMock()
- pipeline.incr = MagicMock()
+ pipeline.incrby = MagicMock()
pipeline.expire = MagicMock()
pipeline.execute = AsyncMock(return_value=[1, True])
pipeline.__aenter__ = AsyncMock(return_value=pipeline)
@@ -24,10 +40,12 @@ async def test_bump_stuck_counter_pipelines_incr_and_expire():
"posthog.temporal.session_replay.rasterize_recording.activities.stuck_counter.get_async_client",
return_value=redis_client,
):
- await bump_stuck_counter_activity(BumpStuckCounterInput(team_id=42, session_id="abc"))
+ await bump_stuck_counter_activity(
+ BumpStuckCounterInput(team_id=42, session_id="abc", killed_worker=killed_worker)
+ )
- pipeline.incr.assert_called_once_with("replay:rasterize:stuck:42:abc")
- pipeline.expire.assert_called_once_with("replay:rasterize:stuck:42:abc", _STUCK_TTL_SECONDS)
+ pipeline.incrby.assert_called_once_with("replay:rasterize:stuck:42:abc", expected_amount)
+ pipeline.expire.assert_called_once_with("replay:rasterize:stuck:42:abc", expected_ttl)
pipeline.execute.assert_awaited_once()
diff --git a/posthog/temporal/tests/session_replay/rasterize_recording/test_workflow.py b/posthog/temporal/tests/session_replay/rasterize_recording/test_workflow.py
index 0e84c0e10804..8f2dd87b5e46 100644
--- a/posthog/temporal/tests/session_replay/rasterize_recording/test_workflow.py
+++ b/posthog/temporal/tests/session_replay/rasterize_recording/test_workflow.py
@@ -60,14 +60,30 @@ def _search_attributes(team_id: int = 7, session_id: str = "sess-123") -> TypedS
)
-async def test_terminal_failure_bumps_stuck_counter():
+async def _run_terminally_failing_workflow(
+ session_id: str, record_calls: list[RecordRasterizationFailureInput], *, fail_at: str = "prep"
+) -> list[BumpStuckCounterInput]:
+ """One workflow run whose first (and only) attempt fails at `fail_at` (prep or render); returns the bump inputs."""
+ from django.conf import settings
+
+ from posthog.temporal.session_replay.rasterize_recording.types import RasterizationActivityInput
+
bump_calls: list[BumpStuckCounterInput] = []
- record_calls: list[RecordRasterizationFailureInput] = []
@activity.defn(name="build_rasterization_input")
- async def build_failing(_exported_asset_id: int) -> BuildRasterizationResult:
- raise RuntimeError("synthetic prep failure")
+ async def build_mocked(_exported_asset_id: int) -> BuildRasterizationResult:
+ if fail_at == "prep":
+ raise RuntimeError("synthetic prep failure")
+ return BuildRasterizationResult(
+ activity_input=RasterizationActivityInput(
+ session_id=session_id, team_id=7, s3_bucket="bucket", s3_key_prefix="prefix"
+ ),
+ render_fingerprint="abc",
+ )
+
+ @activity.defn(name="rasterize-recording")
+ async def render_failing(_inputs: dict) -> dict:
+ raise ApplicationError("synthetic render failure", non_retryable=True)
@activity.defn(name="finalize_rasterization")
async def finalize_unused(_inputs: FinalizeRasterizationInput) -> None:
@@ -80,12 +96,19 @@ async def test_terminal_failure_bumps_stuck_counter():
task_queue = str(uuid.uuid4())
async with await WorkflowEnvironment.start_time_skipping() as env:
await _register_search_attributes(env)
- async with Worker(
- env.client,
- task_queue=task_queue,
- workflows=[RasterizeRecordingWorkflow],
- activities=[build_failing, finalize_unused, bump_mocked, _record_failure_into(record_calls)],
- workflow_runner=temporalio.worker.UnsandboxedWorkflowRunner(),
+ async with (
+ Worker(
+ env.client,
+ task_queue=task_queue,
+ workflows=[RasterizeRecordingWorkflow],
+ activities=[build_mocked, finalize_unused, bump_mocked, _record_failure_into(record_calls)],
+ workflow_runner=temporalio.worker.UnsandboxedWorkflowRunner(),
+ ),
+ Worker(
+ env.client,
+ task_queue=settings.RASTERIZATION_TASK_QUEUE,
+ activities=[render_failing],
+ ),
):
with pytest.raises(Exception):
await env.client.execute_workflow(
@@ -95,8 +118,16 @@ async def test_terminal_failure_bumps_stuck_counter():
task_queue=task_queue,
# maximum_attempts=1 so the FIRST failure is the terminal one.
retry_policy=RetryPolicy(maximum_attempts=1),
- search_attributes=_search_attributes(team_id=7, session_id="sess-123"),
+ search_attributes=_search_attributes(team_id=7, session_id=session_id),
)
+ return bump_calls
+
+
+async def test_terminal_failure_bumps_stuck_counter():
+ record_calls: list[RecordRasterizationFailureInput] = []
+
+ bump_calls = await _run_terminally_failing_workflow("sess-123", record_calls)
assert bump_calls == [BumpStuckCounterInput(team_id=7, session_id="sess-123")]
# The code has to come off the wrapped cause, not the ActivityError Temporal raises here.
@@ -104,6 +135,37 @@ async def test_terminal_failure_bumps_stuck_counter():
assert [(call.exported_asset_id, call.error_code) for call in record_calls] == [(42, "RuntimeError")]
+async def test_killed_worker_render_failure_quarantines_immediately(monkeypatch):
+ # A timeout-class final failure in the render phase must bump with killed_worker=True, or a
+ # worker-killing recording waits for a second whole retry envelope before the quarantine
+ # engages. The classifier is patched because the test server cannot mint a real heartbeat
+ # timeout without a live worker hanging for the full 30s timeout; the classifier itself is
+ # covered by test_resolve_error_code_maps_temporal_timeouts.
+ monkeypatch.setattr(
+ "posthog.temporal.session_replay.rasterize_recording.workflow._resolve_error_code",
+ lambda _exc: "ACTIVITY_TIMEOUT",
+ )
+
+ bump_calls = await _run_terminally_failing_workflow("sess-huge", [], fail_at="render")
+
+ assert bump_calls == [BumpStuckCounterInput(team_id=7, session_id="sess-huge", killed_worker=True)]
+
+
+async def test_timeout_outside_the_render_phase_does_not_quarantine(monkeypatch):
+ # A timed-out prep activity (a Postgres incident, not the recording) must stay on the ordinary
+ # two-strike path; quarantining it for 24h would silence scans for sessions the renderer never opened.
+ monkeypatch.setattr(
+ "posthog.temporal.session_replay.rasterize_recording.workflow._resolve_error_code",
+ lambda _exc: "ACTIVITY_TIMEOUT",
+ )
+
+ bump_calls = await _run_terminally_failing_workflow("sess-db-blip", [], fail_at="prep")
+
+ assert bump_calls == [BumpStuckCounterInput(team_id=7, session_id="sess-db-blip", killed_worker=False)]
+
+
def _scheduled_activities(history: WorkflowHistory) -> list[str]:
return [
event.activity_task_scheduled_event_attributes.activity_type.name
diff --git a/products/exports/backend/tasks/failure_handler.py b/products/exports/backend/tasks/failure_handler.py
index 128011fa87cc..b94ac21ced63 100644
--- a/products/exports/backend/tasks/failure_handler.py
+++ b/products/exports/backend/tasks/failure_handler.py
@@ -68,6 +68,7 @@ RASTERIZATION_CODE_TO_FAILURE_TYPE: dict[str, str] = {
# these as "system" would put them in front of whoever watches infra alerts.
"NO_SNAPSHOTS": FAILURE_TYPE_USER,
"INVALID_INPUT": FAILURE_TYPE_USER,
+ "RECORDING_TOO_LARGE": FAILURE_TYPE_USER,
# Reaching the recording's data failed, which nobody exporting it can do anything about.
"DATA_LOAD_FAILED": FAILURE_TYPE_SYSTEM,
"S3_UPLOAD_UNDECODABLE_RESPONSE": FAILURE_TYPE_SYSTEM,
@@ -93,6 +94,7 @@ _RASTERIZATION_MESSAGES: dict[str, str] = {
"BEGINFRAME_DEADLOCK": "The render stopped responding. Try exporting a shorter part of the recording.",
"NO_SNAPSHOTS": "This recording has no playable data, so there is nothing to export.",
"INVALID_INPUT": "This export request was not valid. Contact support if it keeps happening.",
+ "RECORDING_TOO_LARGE": "This recording is too large to render as a video.",
"DATA_LOAD_FAILED": "We could not load this recording's data. Try the export again in a few minutes.",
"S3_UPLOAD_UNDECODABLE_RESPONSE": "The finished video could not be saved. Try the export again.",
"S3_UPLOAD_FAILED": "The finished video could not be saved. Try the export again.",