Skip to content

Conversation

@charleskorn
Copy link
Contributor

What this PR does

This PR adds the trace ID (if any) to the panic message used if the estimated memory consumption of a query becomes negative.

Which issue(s) this PR fixes or relates to

#11615, #11654

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 June 12, 2025 05:28
@charleskorn charleskorn requested a review from a team as a code owner June 12, 2025 05:28
@aknuds1 aknuds1 requested a review from Copilot June 12, 2025 06:12
Copy link
Contributor

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 updates various test files to propagate a proper context into the memory consumption tracker and removes duplicate context initializations. The key changes include replacing direct calls to limiter.NewMemoryConsumptionTracker(0, nil, "") with calls that pass context (typically context.Background()), and removing redundant context instantiations within tests.

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/streamingpromql/operators/selectors/instant_vector_selector_test.go Passes context to memory tracker and removes duplicate ctx initialization.
pkg/streamingpromql/operators/operator_buffer_test.go Updates memory tracker construction and removes redundant context definitions.
pkg/streamingpromql/operators/functions/*_test.go Consistently passes a valid context to the memory tracker in various function tests.
pkg/streamingpromql/operators/binops/*_test.go Updates binary operation tests to use context in memory tracker instantiation.
pkg/streamingpromql/operators/aggregations/*_test.go Adapts aggregation test files to pass context and improve consistency.
pkg/querier/*_test.go and pkg/ingester/client/streaming_test.go Pass context into the memory tracker, ensuring consistent propagation in streaming tests.

Copy link
Contributor

@56quarters 56quarters left a comment

Choose a reason for hiding this comment

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

LGTM modulo Oleg's suggestion

@charleskorn charleskorn added the changelog-not-needed PRs that don't need a CHANGELOG.md entry label Jun 17, 2025
@charleskorn charleskorn merged commit 8b5019b into main Jun 17, 2025
32 of 33 checks passed
@charleskorn charleskorn deleted the charleskorn/mqe-panic-include-trace-id branch June 17, 2025 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-not-needed PRs that don't need a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants