Skip to content

Commit

Permalink
fallback on bad request proxying (ydb-platform#4566)
Browse files Browse the repository at this point in the history
  • Loading branch information
StekPerepolnen authored and MrLolthe1st committed May 28, 2024
1 parent 6efe6f4 commit cf69bc8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion ydb/core/viewer/json_autocomplete.h
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,12 @@ class TJsonAutocomplete : public TViewerPipeClient<TJsonAutocomplete> {
}

void Handle(TEvViewer::TEvViewerResponse::TPtr& ev) {
ProxyResult = ev.Release()->Release();
if (ev.Get()->Get()->Record.HasAutocompleteResponse()) {
ProxyResult = ev.Release()->Release();
} else {
Direct = true;
SendSchemeCacheRequest(); // fallback
}
RequestDone();
}

Expand Down
7 changes: 6 additions & 1 deletion ydb/core/viewer/json_query.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,12 @@ class TJsonQuery : public TViewerPipeClient<TJsonQuery> {
}

void HandleReply(TEvViewer::TEvViewerResponse::TPtr& ev) {
Handle(*(ev.Get()->Get()->Record.MutableQueryResponse()));
auto& record = ev.Get()->Get()->Record;
if (record.HasQueryResponse()) {
Handle(*(ev.Get()->Get()->Record.MutableQueryResponse()));
} else {
SendKpqProxyRequest(); // fallback
}
}

void HandleReply(NKqp::TEvKqp::TEvAbortExecution::TPtr& ev) {
Expand Down
7 changes: 6 additions & 1 deletion ydb/core/viewer/json_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ class TJsonRender : public TViewerPipeClient<TJsonRender> {
}

void Handle(TEvViewer::TEvViewerResponse::TPtr& ev) {
HandleRenderResponse(*(ev.Get()->Get()->Record.MutableRenderResponse()));
auto& record = ev.Get()->Get()->Record;
if (record.HasRenderResponse()) {
HandleRenderResponse(*(record.MutableRenderResponse()));
} else {
SendGraphRequest(); // fallback
}
}

void HandleTimeout() {
Expand Down

0 comments on commit cf69bc8

Please sign in to comment.