yiguolei commented on code in PR #32039:
URL: https://github.com/apache/doris/pull/32039#discussion_r1519067044
##########
be/src/runtime/thread_context.h:
##########
@@ -305,7 +356,18 @@ class SwitchThreadMemTrackerLimiter {
explicit SwitchThreadMemTrackerLimiter(const
std::shared_ptr<MemTrackerLimiter>& mem_tracker) {
ThreadLocalHandle::create_thread_local_if_not_exits();
_old_mem_tracker =
thread_context()->thread_mem_tracker_mgr->limiter_mem_tracker();
-
thread_context()->thread_mem_tracker_mgr->attach_limiter_tracker(mem_tracker,
TUniqueId());
+
thread_context()->thread_mem_tracker_mgr->attach_limiter_tracker(mem_tracker);
+ }
+
+ explicit SwitchThreadMemTrackerLimiter(const QueryThreadContext&
query_thread_context) {
+ ThreadLocalHandle::create_thread_local_if_not_exits();
+ CHECK(thread_context()->task_id() ==
+ query_thread_context.query_id); // TODO modify to DCHECK
+ CHECK(thread_context()->thread_mem_tracker_mgr->fragment_instance_id()
==
+ query_thread_context.fragment_instance_id); // TODO modify to
DCHECK
Review Comment:
这么写感觉不对,比如在一个线程里连续两次调用SwitchThreadMemTrackerLimiter 之后,感觉结果是错的
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]