summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksandr Khoroshilov <[email protected]>2022-05-23 13:55:33 +0300
committerAleksandr Khoroshilov <[email protected]>2022-05-23 13:55:33 +0300
commit57ac751e49fb70ea74e9c6def5d7653e0b460043 (patch)
treee9bd492904de467cb99402981512a824fda736b3
parent2909708056b5a7991d3306f8265995a4c09ec9dd (diff)
Keep Loopback Cookies + use Loopback in node-collocated tests
ref:949c217d088626a360311723fc2a22bbbcae44d2
-rw-r--r--ydb/core/yq/libs/private_client/loopback_service.cpp26
1 files changed, 16 insertions, 10 deletions
diff --git a/ydb/core/yq/libs/private_client/loopback_service.cpp b/ydb/core/yq/libs/private_client/loopback_service.cpp
index 3f4126c4b42..e99ddd65f4b 100644
--- a/ydb/core/yq/libs/private_client/loopback_service.cpp
+++ b/ydb/core/yq/libs/private_client/loopback_service.cpp
@@ -59,12 +59,13 @@ private:
auto it = Senders.find(ev->Cookie);
if (it != Senders.end()) {
if (ev->Get()->Issues.Size() == 0) {
- Send(it->second, new TEvInternalService::TEvHealthCheckResponse(ev->Get()->Record));
+ Send(it->second, new TEvInternalService::TEvHealthCheckResponse(ev->Get()->Record), 0, OriginalCookies[ev->Cookie]);
} else {
auto issues = ev->Get()->Issues;
- Send(it->second, new TEvInternalService::TEvHealthCheckResponse(NYdb::EStatus::INTERNAL_ERROR, std::move(issues)));
+ Send(it->second, new TEvInternalService::TEvHealthCheckResponse(NYdb::EStatus::INTERNAL_ERROR, std::move(issues)), 0, OriginalCookies[ev->Cookie]);
}
Senders.erase(it);
+ OriginalCookies.erase(ev->Cookie);
}
}
@@ -79,18 +80,20 @@ private:
auto it = Senders.find(ev->Cookie);
if (it != Senders.end()) {
if (ev->Get()->Issues.Size() == 0) {
- Send(it->second, new TEvInternalService::TEvGetTaskResponse(ev->Get()->Record));
+ Send(it->second, new TEvInternalService::TEvGetTaskResponse(ev->Get()->Record), 0, OriginalCookies[ev->Cookie]);
} else {
auto issues = ev->Get()->Issues;
- Send(it->second, new TEvInternalService::TEvGetTaskResponse(NYdb::EStatus::INTERNAL_ERROR, std::move(issues)));
+ Send(it->second, new TEvInternalService::TEvGetTaskResponse(NYdb::EStatus::INTERNAL_ERROR, std::move(issues)), 0, OriginalCookies[ev->Cookie]);
}
Senders.erase(it);
+ OriginalCookies.erase(ev->Cookie);
}
}
void Handle(TEvInternalService::TEvPingTaskRequest::TPtr& ev) {
Cookie++;
Senders[Cookie] = ev->Sender;
+ OriginalCookies[Cookie] = ev->Cookie;
auto request = ev->Get()->Request;
Send(NYq::ControlPlaneStorageServiceActorId(), new NYq::TEvControlPlaneStorage::TEvPingTaskRequest(std::move(request)), 0, Cookie);
}
@@ -99,12 +102,13 @@ private:
auto it = Senders.find(ev->Cookie);
if (it != Senders.end()) {
if (ev->Get()->Issues.Size() == 0) {
- Send(it->second, new TEvInternalService::TEvPingTaskResponse(ev->Get()->Record));
+ Send(it->second, new TEvInternalService::TEvPingTaskResponse(ev->Get()->Record), 0, OriginalCookies[ev->Cookie]);
} else {
auto issues = ev->Get()->Issues;
- Send(it->second, new TEvInternalService::TEvPingTaskResponse(NYdb::EStatus::INTERNAL_ERROR, std::move(issues)));
+ Send(it->second, new TEvInternalService::TEvPingTaskResponse(NYdb::EStatus::INTERNAL_ERROR, std::move(issues)), 0, OriginalCookies[ev->Cookie]);
}
Senders.erase(it);
+ OriginalCookies.erase(ev->Cookie);
}
}
@@ -119,18 +123,20 @@ private:
auto it = Senders.find(ev->Cookie);
if (it != Senders.end()) {
if (ev->Get()->Issues.Size() == 0) {
- Send(it->second, new TEvInternalService::TEvWriteResultResponse(ev->Get()->Record));
+ Send(it->second, new TEvInternalService::TEvWriteResultResponse(ev->Get()->Record), 0, OriginalCookies[ev->Cookie]);
} else {
auto issues = ev->Get()->Issues;
- Send(it->second, new TEvInternalService::TEvWriteResultResponse(NYdb::EStatus::INTERNAL_ERROR, std::move(issues)));
+ Send(it->second, new TEvInternalService::TEvWriteResultResponse(NYdb::EStatus::INTERNAL_ERROR, std::move(issues)), 0, OriginalCookies[ev->Cookie]);
}
Senders.erase(it);
+ OriginalCookies.erase(ev->Cookie);
}
}
const NMonitoring::TDynamicCounterPtr ServiceCounters;
- ui32 Cookie = 0;
- THashMap<ui32, NActors::TActorId> Senders;
+ ui64 Cookie = 0;
+ THashMap<ui64, NActors::TActorId> Senders;
+ THashMap<ui64, ui64> OriginalCookies;
};
NActors::IActor* CreateLoopbackServiceActor(