Skip to content

Conversation

alexmojaki
Copy link
Contributor

No description provided.

Copy link

cloudflare-workers-and-pages bot commented Oct 3, 2025

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4027982
Status: ✅  Deploy successful!
Preview URL: https://7986d4ae.logfire-docs.pages.dev
Branch Preview URL: https://alex-canon-recursion.logfire-docs.pages.dev

View logs

# These can easily vary between runs and we don't want to pay attention to them,
# the real problem is the recursion itself.
parts.append('\n<recursion detected>\n')
break
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's what happens without this:

Screenshot 2025-10-03 at 15 38 05

@alexmojaki alexmojaki requested a review from Copilot October 3, 2025 13:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the canonicalize_exception_traceback function to better handle RecursionError exceptions by detecting recursive patterns and truncating the traceback output to avoid overwhelming detail from non-recursive frames at the end of the stack.

Key changes:

  • Added recursion detection logic that triggers after 100 repeated frames for RecursionError exceptions
  • Enhanced test coverage with comprehensive recursion scenarios

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
logfire/_internal/utils.py Added recursion detection and early termination logic for RecursionError tracebacks
tests/test_canonicalize_exception.py Added comprehensive test cases covering different recursion patterns

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@alexmojaki alexmojaki requested a review from dmontagu October 3, 2025 13:42
@alexmojaki alexmojaki merged commit 135ed88 into main Oct 3, 2025
14 checks passed
@alexmojaki alexmojaki deleted the alex/canon-recursion branch October 3, 2025 14:26
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