Skip to content

Commit

Permalink
fix: data race when accessing field_ when retrieving (#39152)
Browse files Browse the repository at this point in the history
issue: #39148
pr: #39151

Signed-off-by: chyezh <[email protected]>
  • Loading branch information
chyezh authored Jan 13, 2025
1 parent 39fa00f commit 0aa592b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/core/src/segcore/SegmentSealedImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,11 @@ SegmentSealedImpl::bulk_subscript(
return fill_with_empty(field_id, 0);
}

auto column = fields_.at(field_id);
std::shared_ptr<SingleChunkColumnBase> column;
{
std::shared_lock lck(mutex_);
column = fields_.at(field_id);
}
auto ret = fill_with_empty(field_id, count);
if (column->IsNullable()) {
auto dst = ret->mutable_valid_data()->mutable_data();
Expand Down

0 comments on commit 0aa592b

Please sign in to comment.