Skip to content

Commit

Permalink
[BugFix] Fix thrift RuntimeProfile child node number not consistent (#…
Browse files Browse the repository at this point in the history
…54837)

Signed-off-by: PengFei Li <[email protected]>
(cherry picked from commit ba7737d)
  • Loading branch information
banmoy authored and mergify[bot] committed Jan 9, 2025
1 parent bda9041 commit ac04c37
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions be/src/util/runtime_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,13 +746,10 @@ void RuntimeProfile::to_thrift(TRuntimeProfileTree* tree) {
}

void RuntimeProfile::to_thrift(std::vector<TRuntimeProfileNode>* nodes) {
nodes->reserve(nodes->size() + _children.size());

int index = nodes->size();
nodes->emplace_back();
TRuntimeProfileNode& node = (*nodes)[index];
node.name = _name;
node.num_children = _children.size();
node.metadata = _metadata;
node.indent = true;

Expand Down Expand Up @@ -810,6 +807,8 @@ void RuntimeProfile::to_thrift(std::vector<TRuntimeProfileNode>* nodes) {
std::lock_guard<std::mutex> l(_children_lock);
children = _children;
}
node.num_children = children.size();
nodes->reserve(nodes->size() + children.size());

for (auto& i : children) {
int child_idx = nodes->size();
Expand Down

0 comments on commit ac04c37

Please sign in to comment.