[fix] (mem tracker) Fix core dump during transmit_block (#10133)

In some cases, query mem tracker does not exist in BE when transmit block. This will result in a null pointer for get query mem tracker in brpc transmit_block
This commit is contained in:
Xinyi Zou
2022-06-17 00:01:30 +08:00
committed by GitHub
parent 8d98c17c4e
commit c784fb3ddd
2 changed files with 22 additions and 9 deletions

View File

@ -123,8 +123,9 @@ public:
void attach(const TaskType& type, const std::string& task_id,
const TUniqueId& fragment_instance_id,
const std::shared_ptr<doris::MemTracker>& mem_tracker) {
std::string new_tracker_label = mem_tracker == nullptr ? "null" : mem_tracker->label();
DCHECK((_type == TaskType::UNKNOWN || _type == TaskType::BRPC) && _task_id == "")
<< ",new tracker label: " << mem_tracker->label()
<< ",new tracker label: " << new_tracker_label
<< ",old tracker label: " << _thread_mem_tracker_mgr->mem_tracker()->label();
DCHECK(type != TaskType::UNKNOWN);
_type = type;