Skip to content

Commit cbb68bd

Browse files
authored
Use exprnode only from main thread (#8827)
1 parent 85d1fd0 commit cbb68bd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ydb/library/yql/providers/yt/gateway/qplayer/yql_yt_qplayer_gateway.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,14 @@ class TGateway : public IYtGateway {
315315
}
316316

317317
NThreading::TFuture<TTableRangeResult> GetTableRange(TTableRangeOptions&& options) final {
318+
TString key;
319+
if (QContext_) {
320+
key = MakeGetTableRangeKey(options);
321+
}
322+
318323
if (QContext_.CanRead()) {
319324
TTableRangeResult res;
320325
res.SetSuccess();
321-
auto key = MakeGetTableRangeKey(options);
322326
auto item = QContext_.GetReader()->Get({YtGateway_GetTableRange, key}).GetValueSync();
323327
if (!item) {
324328
throw yexception() << "Missing replay data";
@@ -354,9 +358,8 @@ class TGateway : public IYtGateway {
354358
return NThreading::MakeFuture<TTableRangeResult>(res);
355359
}
356360

357-
auto optionsDup = options;
358361
return Inner_->GetTableRange(std::move(options))
359-
.Subscribe([optionsDup, qContext = QContext_](const NThreading::TFuture<TTableRangeResult>& future) {
362+
.Subscribe([key, qContext = QContext_](const NThreading::TFuture<TTableRangeResult>& future) {
360363
if (!qContext.CanWrite() || future.HasException()) {
361364
return;
362365
}
@@ -366,7 +369,6 @@ class TGateway : public IYtGateway {
366369
return;
367370
}
368371

369-
const auto& key = MakeGetTableRangeKey(optionsDup);
370372
auto listNode = NYT::TNode::CreateList();
371373
for (const auto& t : res.Tables) {
372374
listNode.Add();

0 commit comments

Comments
 (0)