Skip to content

Commit 80e5c94

Browse files
authored
generic_lookup_actor: add basic error handling (#9396)
1 parent 81935d7 commit 80e5c94

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-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
@@ -101,8 +101,17 @@ class TInputTransformStreamLookupBase
101101
private: //events
102102
STRICT_STFUNC(StateFunc,
103103
hFunc(IDqAsyncLookupSource::TEvLookupResult, Handle);
104+
hFunc(IDqComputeActorAsyncInput::TEvAsyncInputError, Handle);
104105
)
105106

107+
void Handle(IDqComputeActorAsyncInput::TEvAsyncInputError::TPtr ev) {
108+
auto evptr = ev->Get();
109+
Send(ComputeActorId, new IDqComputeActorAsyncInput::TEvAsyncInputError(
110+
InputIndex,
111+
evptr->Issues,
112+
evptr->FatalCode));
113+
}
114+
106115
void AddReadyQueue(NUdf::TUnboxedValue& lookupKey, NUdf::TUnboxedValue& inputOther, NUdf::TUnboxedValue *lookupPayload) {
107116
NUdf::TUnboxedValue* outputRowItems;
108117
NUdf::TUnboxedValue outputRow = HolderFactory.CreateDirectArrayHolder(OutputRowColumnOrder.size(), outputRowItems);

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,14 @@ namespace NYql::NDq {
195195
FinalizeRequest();
196196
}
197197

198-
void Handle(TEvError::TPtr) {
199-
FinalizeRequest();
198+
void Handle(TEvError::TPtr ev) {
199+
auto actorSystem = TActivationContext::ActorSystem();
200+
auto error = ev->Get()->Error;
201+
auto errEv = std::make_unique<IDqComputeActorAsyncInput::TEvAsyncInputError>(
202+
-1,
203+
NConnector::ErrorToIssues(error),
204+
NConnector::ErrorToDqStatus(error));
205+
actorSystem->Send(new NActors::IEventHandle(ParentId, SelfId(), errEv.release()));
200206
}
201207

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

0 commit comments

Comments
 (0)