Skip to content

Commit

Permalink
Improve getting actorsystem [yql] (#14009)
Browse files Browse the repository at this point in the history
  • Loading branch information
kruall authored Jan 30, 2025
1 parent 33b41a1 commit 8b9ae32
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions ydb/library/yql/providers/dq/actors/yt/lock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct TLockRequest: public TActor<TLockRequest> {
if (result.IsOK()) {
NYT::NApi::TLockNodeOptions options;
options.Waitable = false;
auto* actorSystem = ctx.ExecutorThread.ActorSystem;
auto* actorSystem = ctx.ActorSystem();
auto selfId = SelfId();
try {
YT_UNUSED_FUTURE(Transaction->LockNode("#" + ToString(result.ValueOrThrow()), NYT::NCypressClient::ELockMode::Exclusive, options).As<void>()
Expand Down Expand Up @@ -224,7 +224,7 @@ struct TLockRequest: public TActor<TLockRequest> {
template<typename T>
void Finish(const NYT::TErrorOr<T>& result, const TActorContext& ctx) {
if (result.IsOK()) {
auto* actorSystem = ctx.ExecutorThread.ActorSystem;
auto* actorSystem = ctx.ActorSystem();
auto selfId = SelfId();
Transaction->SubscribeAborted(BIND([actorSystem, selfId](const NYT::TError& /*error*/) {
actorSystem->Send(selfId, new TEvents::TEvPoison());
Expand All @@ -247,7 +247,7 @@ struct TLockRequest: public TActor<TLockRequest> {
auto lockNode = Prefix + "/" + LockName + ".lock";

try {
auto* actorSystem = ctx.ExecutorThread.ActorSystem;
auto* actorSystem = ctx.ActorSystem();
auto selfId = SelfId();
YT_UNUSED_FUTURE(Transaction->CreateNode(
lockNode,
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/yql/providers/dq/actors/yt/yt_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ namespace NYql {

template<typename T>
TWeakPtr<T> NewRequest(ui64 id, TActorId sender, const TActorContext& ctx) {
auto req = New<T>(SelfId(), sender, ctx.ExecutorThread.ActorSystem, id);
auto req = New<T>(SelfId(), sender, ctx.ActorSystem(), id);
Requests.emplace(req);
return NYT::MakeWeak(req);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class TServiceNodePinger: public TActor<TServiceNodePinger> {
req.AddKnownNodes(node);
}

auto* actorSystem = ctx.ExecutorThread.ActorSystem;
auto* actorSystem = ctx.ActorSystem();
auto selfId = SelfId();

Resolver->GetConnection()
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/yql/providers/dq/service/grpc_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace NYql::NDqs {
YQL_LOG_CTX_ROOT_SESSION_SCOPE(TraceId);
if (!CtxSubscribed) {
auto selfId = ctx.SelfID;
auto* actorSystem = ctx.ExecutorThread.ActorSystem;
auto* actorSystem = ctx.ActorSystem();
Ctx->GetFinishFuture().Subscribe([selfId, actorSystem](const NYdbGrpc::IRequestContextBase::TAsyncFinishResult& future) {
Y_ABORT_UNLESS(future.HasValue());
if (future.GetValue() == NYdbGrpc::IRequestContextBase::EFinishStatus::CANCEL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class TTaskRunnerActor
i64 space,
bool finish) override
{
auto* actorSystem = NActors::TlsActivationContext->ExecutorThread.ActorSystem;
auto* actorSystem = NActors::TActivationContext::ActorSystem();
auto selfId = SelfId();

YQL_ENSURE(!batch.IsWide());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TWorkerManagerCommon: public TRichActor<TDerived> {
auto localRequest = MakeHolder<NActors::TEvInterconnect::TEvListNodes>();

auto replyTo = ev->Sender;
auto* actorSystem = ctx.ExecutorThread.ActorSystem;
auto* actorSystem = ctx.ActorSystem();

auto callback = MakeHolder<NActors::TActorFutureCallback<NActors::TEvInterconnect::TEvNodesInfo>>(
[replyTo, actorSystem] (TAutoPtr<NActors::TEventHandle<NActors::TEvInterconnect::TEvNodesInfo>>& event) {
Expand Down

0 comments on commit 8b9ae32

Please sign in to comment.