Skip to content

Commit 12df100

Browse files
authored
[EM] Fix race in the iterator accessor policy. (#11664)
1 parent 1e684c3 commit 12df100

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/data/sparse_page_source.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,11 @@ class SparsePageSourceImpl : public BatchIteratorImpl<S>, public FormatStreamPol
319319
if (restart) {
320320
this->param_.prefetch_copy = true;
321321
}
322-
ring_->at(fetch_it) = this->workers_.Submit([fetch_it, self, this] {
322+
auto p = this->param_;
323+
ring_->at(fetch_it) = this->workers_.Submit([fetch_it, self, p, this] {
323324
auto page = std::make_shared<S>();
324325
this->exce_.Run([&] {
325-
std::unique_ptr<typename FormatStreamPolicy::FormatT> fmt{
326-
self->CreatePageFormat(self->param_)};
326+
std::unique_ptr<typename FormatStreamPolicy::FormatT> fmt{self->CreatePageFormat(p)};
327327
auto name = self->cache_info_->ShardName();
328328
auto [offset, length] = self->cache_info_->View(fetch_it);
329329
std::unique_ptr<typename FormatStreamPolicy::ReaderT> fi{

0 commit comments

Comments
 (0)