-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[Bug][MemTracker] Cleanup the mem tracker's constructor to avoid wrong usage #4345
Conversation
… usage If a mem tracker has parent, it should be created by 'CreateTracker'. So I removed other unused contructors.
be/src/runtime/mem_tracker.h
Outdated
/// TODO(cmy): this method is not used for now. the memtracker returned from here is | ||
/// got from a shared_ptr in `pool_to_mem_trackers_`. | ||
/// I don't know why it need to return a raw pointer. | ||
/// If this method be further used, please notice that. |
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.
GetRequestPoolMemTracker is from
https://github.com/cloudera/Impala/blob/495397101e5807c701df71ea288f4815d69c2c8a/be/src/runtime/mem-tracker.h#L497
So we didn't make it shared last time, just Ieave it as it is. Maybe we could return shared ptr, I think there should be no problem.
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.
Okay, since this function has not been used yet, I will change the return value to shared_ptr
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
…g usage (apache#4345) After PR: apache#4135, If a mem tracker has parent, it should be created by 'CreateTracker'. So I removed other unused constructors. And also fix the bug described in apache#4344
…g usage (apache#4345) After PR: apache#4135, If a mem tracker has parent, it should be created by 'CreateTracker'. So I removed other unused constructors. And also fix the bug described in apache#4344
…g usage (apache#4345) After PR: apache#4135, If a mem tracker has parent, it should be created by 'CreateTracker'. So I removed other unused constructors. And also fix the bug described in apache#4344
Proposed changes
After PR: #4135, If a mem tracker has parent, it should be created by 'CreateTracker'.
So I removed other unused constructors.
And also fix the bug described in #4344
Types of changes
Checklist