Skip to content

Commit

Permalink
added RequestDone
Browse files Browse the repository at this point in the history
  • Loading branch information
StekPerepolnen committed Nov 27, 2024
1 parent 5ced356 commit a087ad2
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions ydb/core/viewer/json_pipe_req.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,12 +748,6 @@ void TViewerPipeClient::RequestDone(ui32 requests) {
}
}

void TViewerPipeClient::ResetAndBootstrap() {
Requests = 0;
DelayedRequests.clear();
Bootstrap();
}

void TViewerPipeClient::Handle(TEvTabletPipe::TEvClientConnected::TPtr& ev) {
if (ev->Get()->Status != NKikimrProto::OK) {
ui32 requests = FailPipeConnect(ev->Get()->TabletId);
Expand All @@ -769,13 +763,15 @@ void TViewerPipeClient::HandleResolveResource(TEvTxProxySchemeCache::TEvNavigate
SharedDatabase = CanonizePath(entry.Path);
if (SharedDatabase == AppData()->TenantName) {
Direct = true;
return ResetAndBootstrap(); // retry bootstrap without redirect this time
Bootstrap(); // retry bootstrap without redirect this time
} else {
DatabaseBoardInfoResponse = MakeRequestStateStorageEndpointsLookup(SharedDatabase);
}
DatabaseBoardInfoResponse = MakeRequestStateStorageEndpointsLookup(SharedDatabase);
} else {
ReplyAndPassAway(GetHTTPBADREQUEST("text/plain", "Failed to resolve database - shared database not found"));
return ReplyAndPassAway(GetHTTPBADREQUEST("text/plain", "Failed to resolve database - shared database not found"));
}
}
RequestDone();
}

void TViewerPipeClient::HandleResolveDatabase(TEvTxProxySchemeCache::TEvNavigateKeySetResult::TPtr& ev) {
Expand All @@ -786,25 +782,27 @@ void TViewerPipeClient::HandleResolveDatabase(TEvTxProxySchemeCache::TEvNavigate
if (entry.DomainInfo && entry.DomainInfo->ResourcesDomainKey && entry.DomainInfo->DomainKey != entry.DomainInfo->ResourcesDomainKey) {
ResourceNavigateResponse = MakeRequestSchemeCacheNavigate(TPathId(entry.DomainInfo->ResourcesDomainKey));
Become(&TViewerPipeClient::StateResolveResource);
return;
} else {
DatabaseBoardInfoResponse = MakeRequestStateStorageEndpointsLookup(CanonizePath(entry.Path));
}
DatabaseBoardInfoResponse = MakeRequestStateStorageEndpointsLookup(CanonizePath(entry.Path));
} else {
ReplyAndPassAway(GetHTTPBADREQUEST("text/plain", "Failed to resolve database - not found"));
return ReplyAndPassAway(GetHTTPBADREQUEST("text/plain", "Failed to resolve database - not found"));
}
}
RequestDone();
}

void TViewerPipeClient::HandleResolve(TEvStateStorage::TEvBoardInfo::TPtr& ev) {
if (DatabaseBoardInfoResponse) {
DatabaseBoardInfoResponse->Set(std::move(ev));
if (DatabaseBoardInfoResponse->IsOk()) {
ReplyAndPassAway(MakeForward(GetNodesFromBoardReply(DatabaseBoardInfoResponse->GetRef())));
return ReplyAndPassAway(MakeForward(GetNodesFromBoardReply(DatabaseBoardInfoResponse->GetRef())));
} else {
Direct = true;
ResetAndBootstrap(); // retry bootstrap without redirect this time
Bootstrap(); // retry bootstrap without redirect this time
}
}
RequestDone();
}

void TViewerPipeClient::HandleTimeout() {
Expand Down

0 comments on commit a087ad2

Please sign in to comment.