Scaling stack size during operator closing

This commit is contained in:
18523270951@163.com
2024-07-03 14:38:32 +00:00
committed by ob-robot
parent 055a85eb8f
commit da2bc95b50

View File

@ -1062,39 +1062,35 @@ int ObOperator::close()
{ {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
int child_ret = OB_SUCCESS; int child_ret = OB_SUCCESS;
if (OB_FAIL(check_stack_overflow())) { OperatorOpenOrder open_order = get_operator_open_order();
LOG_WARN("failed to check stack overflow", K(ret)); if (OPEN_SELF_ONLY != open_order) {
} else { //first call close of children
OperatorOpenOrder open_order = get_operator_open_order(); for (int64_t i = 0; i < child_cnt_; ++i) {
if (OPEN_SELF_ONLY != open_order) { // children_ pointer is checked before operator open, no need check again.
//first call close of children int tmp_ret = SMART_CALL(children_[i]->close());
for (int64_t i = 0; i < child_cnt_; ++i) { if (OB_SUCCESS != tmp_ret) {
// children_ pointer is checked before operator open, no need check again. ret = OB_SUCCESS == ret ? tmp_ret : ret;
int tmp_ret = children_[i]->close(); LOG_WARN("Close child operator failed", K(child_ret), "op_type", op_name());
if (OB_SUCCESS != tmp_ret) {
ret = OB_SUCCESS == ret ? tmp_ret : ret;
LOG_WARN("Close child operator failed", K(child_ret), "op_type", op_name());
}
} }
} }
}
// no matter what, must call operator's close function // no matter what, must call operator's close function
int tmp_ret = inner_close(); int tmp_ret = inner_close();
if (OB_SUCCESS != tmp_ret) { if (OB_SUCCESS != tmp_ret) {
ret = tmp_ret; // overwrite child's error code. ret = tmp_ret; // overwrite child's error code.
LOG_WARN("Close this operator failed", K(ret), "op_type", op_name()); LOG_WARN("Close this operator failed", K(ret), "op_type", op_name());
} }
IGNORE_RETURN submit_op_monitor_node(); IGNORE_RETURN submit_op_monitor_node();
IGNORE_RETURN setup_op_feedback_info(); IGNORE_RETURN setup_op_feedback_info();
#ifdef ENABLE_DEBUG_LOG #ifdef ENABLE_DEBUG_LOG
if (nullptr != dummy_mem_context_) { if (nullptr != dummy_mem_context_) {
if (nullptr != dummy_ptr_) { if (nullptr != dummy_ptr_) {
dummy_mem_context_->get_malloc_allocator().free(dummy_ptr_); dummy_mem_context_->get_malloc_allocator().free(dummy_ptr_);
dummy_ptr_ = nullptr; dummy_ptr_ = nullptr;
} }
} }
#endif #endif
}
return ret; return ret;
} }