Skip to content

fix: memory leak in OTEL traces

b6d3c31
Select commit
Loading
Failed to load commit list.
Open

Fix memory leak in OTEL traces #1639

fix: memory leak in OTEL traces
b6d3c31
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Apr 23, 2026 in 15m 27s

Code review found 1 important issue

Found 5 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important langfuse/_task_manager/media_manager.py:187-201 Pydantic model_dump/dict exceptions can break user code

Annotations

Check failure on line 201 in langfuse/_task_manager/media_manager.py

See this annotation in the file changed.

@claude claude / Claude Code Review

Pydantic model_dump/dict exceptions can break user code

The new Pydantic v2/v1 branches call `data.model_dump()` (line 187) and `data.dict()` (line 202) with no exception handling, so a model whose serializer raises (e.g. a `@field_serializer` that raises, `arbitrary_types_allowed` with unserializable fields, or unresolved forward references) will now propagate the exception out of `_find_and_process_media` → `_process_media_in_attribute` → `_process_media_and_apply_mask` into user code. Pre-PR such models fell through to `return data` and were absor