-
Notifications
You must be signed in to change notification settings - Fork 634
MQE: Panic when memory isn't managed as we expect #9121
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
Conversation
For use in tests
We would get a new slice when we already had an existing slice we were keeping around for use.
// Increase the memory tracker for 2 FPoints, and 1 HPoint | ||
memoryConsumptionTracker.IncreaseMemoryConsumption(types.FPointSize*2 + types.HPointSize*1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this necessary? Can't we just assert that CurrentEstimatedMemoryConsumptionBytes
is 0 below?
(same comment applies to the other similar changes in this file)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the functions we're testing actually call DecreaseMemoryConsumption
at some point, which requires the current estimated memory to be larger than what is returned. I figured may as well put in real values if that path is being executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I'm missing something: where is DecreaseMemoryConsumption
called in this test? floatTransformationFunc
reuses the slice it's passed.
(I can see this is necessary for TestFloatTransformationDropHistogramsFunc
though)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, sorry, I see your point. I'm doing this for consistency with TestFloatTransformationDropHistogramsFunc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and nice catch on the issue in the binary operator 🚀
What this PR does
Which issue(s) this PR fixes or relates to
Related to https://github.com/grafana/mimir-squad/issues/2280
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.