Skip to content

Commit b45266b

Browse files
add chunk error handler
1 parent e088f9e commit b45266b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

ydb/core/mon/mon.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,8 +1204,17 @@ class THttpMonAuthorizedActorRequest : public TActorBootstrapped<THttpMonAuthori
12041204
}
12051205

12061206
void Handle(NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk::TPtr& ev) {
1207-
Send(Event->Sender, new NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk(ev->Get()->DataChunk), 0, Event->Cookie);
1208-
if (ev->Get()->DataChunk && ev->Get()->DataChunk->IsEndOfData()) {
1207+
bool endOfData = false;
1208+
if (ev->Get()->DataChunk) {
1209+
Send(Event->Sender, new NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk(ev->Get()->DataChunk), 0, Event->Cookie);
1210+
if (ev->Get()->DataChunk->IsEndOfData()) {
1211+
endOfData = true;
1212+
}
1213+
} else if (ev->Get()->Error) {
1214+
Send(Event->Sender, new NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk(ev->Get()->Error), 0, Event->Cookie);
1215+
endOfData = true;
1216+
}
1217+
if (endOfData) {
12091218
PassAway();
12101219
}
12111220
}
@@ -1225,7 +1234,7 @@ class THttpMonAuthorizedActorRequest : public TActorBootstrapped<THttpMonAuthori
12251234
hFunc(NHttp::TEvHttpProxy::TEvHttpOutgoingResponse, Handle);
12261235
hFunc(NHttp::TEvHttpProxy::TEvHttpOutgoingDataChunk, Handle);
12271236
hFunc(NHttp::TEvHttpProxy::TEvSubscribeForCancel, Handle);
1228-
hFunc(NHttp::TEvHttpProxy::TEvRequestCancelled, Handle)
1237+
hFunc(NHttp::TEvHttpProxy::TEvRequestCancelled, Handle);
12291238
}
12301239
}
12311240
};

0 commit comments

Comments
 (0)