Skip to content

fix(telemetry): close failed synchronous memory search spans - #4974

Open
DivyamTalwar wants to merge 1 commit into
latitude-dev:developmentfrom
DivyamTalwar:fix/python-memory-span-cleanup
Open

DivyamTalwar wants to merge 1 commit into
latitude-dev:developmentfrom
DivyamTalwar:fix/python-memory-span-cleanup

Conversation

@DivyamTalwar

@DivyamTalwar DivyamTalwar commented Dec 1, 2026 •

Copy link
Copy Markdown

What does this PR do?

End and detach the memory search span if synchronous result processing raises. A records_from_result callback can fail after the search callback returns. The exception should reach the caller, and the caller's parent span should be restored for subsequent tracing.

How was this tested?

  • Reproduced a failed result mapping with an in-memory OpenTelemetry exporter. The old code left the search span current. The fix records the failure, ends the span, and restores its parent.
  • Independently ran all 13 memory tests and checked cancellation after entering an asynchronous search.
  • All 145 Python telemetry tests passed. Ruff, Pyright, and git diff checks passed.

Checklist

  • Lint, type-checking, and tests pass locally
  • PR title follows Conventional Commits
  • I have signed the CLA

Get evidence
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 22:14
@vercel

vercel Bot commented Dec 1, 2026

Copy link
Copy Markdown

@DivyamTalwar is attempting to deploy a commit to the Latitude Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T22:16:54.363713Z fa8f071 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants