Skip to content

fix(traceql): err on division by zero#6580

Merged
mdisibio merged 5 commits intomainfrom
mariell/fix-div-by-0
Mar 9, 2026
Merged

fix(traceql): err on division by zero#6580
mdisibio merged 5 commits intomainfrom
mariell/fix-div-by-0

Conversation

@Proximyst
Copy link
Copy Markdown
Member

@Proximyst Proximyst commented Feb 27, 2026

Right now, Tempo will panic in the request goroutine if we use a query like { 1 / 0 = 1 }. Instead, an error should be returned such that the query simply cannot return any results.

Note: the bug and fix were both LLM-driven.

Which issue(s) this PR fixes:
Fixes #6579

Checklist

  • Tests updated
  • Documentation added
    • I don't think we need any?
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Right now, Tempo will panic in the request goroutine if we use a query
like `{ 1 / 0 = 1 }`. Instead, an error should be returned such that the
query simply cannot return any results.
@Proximyst Proximyst force-pushed the mariell/fix-div-by-0 branch from 3758fec to b94e9a5 Compare February 27, 2026 13:14
@Proximyst
Copy link
Copy Markdown
Member Author

@codex Please review the PR

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Contributor

@mdisibio mdisibio left a comment

Choose a reason for hiding this comment

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

Hi, thanks for the fix, interestingly it highlights how we are handling integers and floats differently. Floats aren't panicking, (and digging into it 1.0 / 0.0 results in +Inf). So although we might need to make additional changes later, returning the error here is a straight improvement over panicking.

Can you add a bugfix line to the changelog?

@mdisibio mdisibio merged commit be79018 into main Mar 9, 2026
24 checks passed
@mdisibio mdisibio deleted the mariell/fix-div-by-0 branch March 9, 2026 18:00
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.

Division by zero panics AST executor

2 participants