Skip to content

Commit 13469ec

Browse files
committed
generic_lookup_actor: add basic error handling
1 parent 3a4de79 commit 13469ec

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

ydb/library/yql/dq/actors/input_transforms/dq_input_transform_lookup.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,17 @@ class TInputTransformStreamLookupBase
8787
private: //events
8888
STRICT_STFUNC(StateFunc,
8989
hFunc(IDqAsyncLookupSource::TEvLookupResult, Handle);
90+
hFunc(IDqComputeActorAsyncInput::TEvAsyncInputError, Handle);
9091
)
9192

93+
void Handle(IDqComputeActorAsyncInput::TEvAsyncInputError::TPtr ev) {
94+
auto evptr = ev->Get();
95+
Send(ComputeActorId, new IDqComputeActorAsyncInput::TEvAsyncInputError(
96+
InputIndex,
97+
evptr->Issues,
98+
evptr->FatalCode));
99+
}
100+
92101
void Handle(IDqAsyncLookupSource::TEvLookupResult::TPtr ev) {
93102
auto guard = BindAllocator();
94103
const auto lookupResult = std::move(ev->Get()->Result);

ydb/library/yql/providers/generic/actors/yql_generic_lookup_actor.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,17 @@ namespace NYql::NDq {
188188
FinalizeRequest();
189189
}
190190

191-
void Handle(TEvError::TPtr) {
192-
FinalizeRequest();
191+
void Handle(TEvError::TPtr ev) {
192+
auto actorSystem = TActivationContext::ActorSystem();
193+
auto error = ev->Get()->Error;
194+
auto errEv = new IDqComputeActorAsyncInput::TEvAsyncInputError(
195+
-1,
196+
NConnector::ErrorToIssues(error),
197+
NConnector::ErrorToDqStatus(error));
198+
actorSystem->Send(new NActors::IEventHandle(ParentId, SelfId(), errEv));
199+
auto guard = Guard(*Alloc);
200+
TKeyTypeHelper empty;
201+
Request = IDqAsyncLookupSource::TUnboxedValueMap(0, empty.GetValueHash(), empty.GetValueEqual());
193202
}
194203

195204
void Handle(NActors::TEvents::TEvPoison::TPtr) {

0 commit comments

Comments
 (0)