Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix segfault in autocomplete handler when redirecting to a database #8367

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions ydb/core/viewer/viewer_autocomplete.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ using TNavigate = NSchemeCache::TSchemeCacheNavigate;
class TJsonAutocomplete : public TViewerPipeClient {
using TThis = TJsonAutocomplete;
using TBase = TViewerPipeClient;
IViewer* Viewer;
NMon::TEvHttpInfo::TPtr Event;
TEvViewer::TEvViewerRequest::TPtr ViewerRequest;
TJsonSettings JsonSettings;
ui32 Timeout = 0;
Expand Down Expand Up @@ -47,9 +45,8 @@ class TJsonAutocomplete : public TViewerPipeClient {
std::vector<TNodeId> TenantDynamicNodes;
bool Direct = false;
public:
TJsonAutocomplete(IViewer* viewer, NMon::TEvHttpInfo::TPtr &ev)
: Viewer(viewer)
, Event(ev)
TJsonAutocomplete(IViewer* viewer, NMon::TEvHttpInfo::TPtr& ev)
: TBase(viewer, ev)
{
const auto& params(Event->Get()->Request.GetParams());
InitConfig(params);
Expand Down Expand Up @@ -165,7 +162,7 @@ class TJsonAutocomplete : public TViewerPipeClient {
// autocomplete database list via console request
RequestConsoleListTenants();
} else {
Direct |= !Event->Get()->Request.GetHeader("X-Forwarded-From-Node").empty(); // we're already forwarding
Direct |= !TBase::Event->Get()->Request.GetHeader("X-Forwarded-From-Node").empty(); // we're already forwarding
Direct |= (Database == AppData()->TenantName) || Database.empty(); // we're already on the right node or don't use database filter
if (Database && !Direct) {
// proxy request to a dynamic node of the specified database
Expand Down
Loading