8000 Fix issue where a query containing a common subexpression that returned an error could also panic with `integer divide by zero` by charleskorn · Pull Request #11514 · grafana/mimir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix issue where a query containing a common subexpression that returned an error could also panic with integer divide by zero #11514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 25, 2025

Conversation

charleskorn
Copy link
Contributor
@charleskorn charleskorn commented May 23, 2025

What this PR does

This PR fixes an issue where a query containing a common subexpression that returned an error could also panic with integer divide by zero when the query was closed.

This would occur if:

  • the first series read by the duplication operator returned an error
  • all consumers other than the one that made the first NextSeries call were closed before the first NextSeries caller

If these conditions were met, SeriesDataRingBuffer.Remove would panic when evaluating b.startIndex % len(b.data).

As the query was closed after the HTTP response was sent, the user still saw the expected error message, but the querier would have crashed and restarted, so other inflight queries may have been affected.

Which issue(s) this PR fixes or relates to

#11189

Checklist

  • Tests updated.
  • [n/a] Documentation added.
  • [covered by Mimir Query Engine #10067] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • [n/a] about-versioning.md updated with experimental features.

@charleskorn charleskorn marked this pull request as ready for review May 23, 2025 04:09
@charleskorn charleskorn requested a review from a team as a code owner May 23, 2025 04:09
Copy link
Contributor
@narqo narqo left a comment

Choose a reason for hiding this comment

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

🔥

@charleskorn charleskorn merged commit 3dfd17a into main May 25, 2025
30 checks passed
@charleskorn charleskorn deleted the charleskorn/fix-cse-panic branch May 25, 2025 23:11
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.

2 participants
0