This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new f6782d6c6e7 [Fix](point query) avoid nullptr in _block_pool (#33120)
f6782d6c6e7 is described below
commit f6782d6c6e70af8c6b68f61057bdd38ffd8b018a
Author: lihangyu <[email protected]>
AuthorDate: Fri Apr 5 07:59:57 2024 +0800
[Fix](point query) avoid nullptr in _block_pool (#33120)
`resize` will make nullptrs in _block_pool if _block_pool.size() <
s_preallocted_blocks_num
---
be/src/service/point_query_executor.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/be/src/service/point_query_executor.cpp
b/be/src/service/point_query_executor.cpp
index 5744aa390c0..fb4b8130dd7 100644
--- a/be/src/service/point_query_executor.cpp
+++ b/be/src/service/point_query_executor.cpp
@@ -100,12 +100,14 @@ std::unique_ptr<vectorized::Block> Reusable::get_block() {
void Reusable::return_block(std::unique_ptr<vectorized::Block>& block) {
std::lock_guard lock(_block_mutex);
- if (_block_pool.size() > s_preallocted_blocks_num) {
+ if (block == nullptr) {
return;
}
block->clear_column_data();
_block_pool.push_back(std::move(block));
- _block_pool.resize(s_preallocted_blocks_num);
+ if (_block_pool.size() > s_preallocted_blocks_num) {
+ _block_pool.resize(s_preallocted_blocks_num);
+ }
}
int64_t Reusable::mem_size() const {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]