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
…backport #54837) (#54865)

Co-authored-by: PengFei Li <[email protected]>
  • Loading branch information
mergify[bot] and banmoy authored Jan 9, 2025
1 parent bda9041 commit d8efa5a
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 d8efa5a

Please sign in to comment.