Skip to content

Commit ada1f24

Browse files
authored
Don't crash node in the case of duplicate tag. (#11370)
1 parent df96fa4 commit ada1f24

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ydb/core/load_test/service_actor.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -432,17 +432,17 @@ class TLoadActor : public TActorBootstrapped<TLoadActor> {
432432
}
433433

434434
void Handle(TEvLoad::TEvLoadTestRequest::TPtr& ev) {
435-
ui32 status = NMsgBusProxy::MSTATUS_OK;
436-
TString error;
437435
const auto& record = GetFixedRequest(ev);
438-
Y_ENSURE(!RequestSender.contains(record.GetTag()),
439-
"node is currently handling another request with tag# " << record.GetTag());
440-
RequestSender[record.GetTag()] = ev->Sender;
441-
UuidByTag[record.GetTag()] = record.GetUuid();
442436
LOG_N("Load test request arrived from " << ev->Sender.ToString() <<
443437
": tag# " << record.GetTag() <<
444438
", uuid# " << record.GetUuid());
439+
ui32 status = NMsgBusProxy::MSTATUS_OK;
440+
TString error;
445441
try {
442+
Y_ENSURE(!RequestSender.contains(record.GetTag()),
443+
"node is currently handling another request with tag# " << record.GetTag());
444+
RequestSender[record.GetTag()] = ev->Sender;
445+
UuidByTag[record.GetTag()] = record.GetUuid();
446446
ProcessCmd(record);
447447
} catch (const TLoadActorException& ex) {
448448
LOG_E("Exception while creating load actor, what# " << ex.what());
@@ -1060,7 +1060,7 @@ class TLoadActor : public TActorBootstrapped<TLoadActor> {
10601060
if (result.status == "ok") {
10611061
updateStatus(
10621062
"text-success",
1063-
"Started: UUID# " + result.uuid + ", node tag# " + result.tag + ", status# " + result.status
1063+
"Starting: UUID# " + result.uuid + ", node tag# " + result.tag + ", status# " + result.status
10641064
);
10651065
} else {
10661066
updateStatus(

0 commit comments

Comments
 (0)