Skip to content

Commit

Permalink
Throw exception instead of calling exit(1) in TBasicServicesInitializ…
Browse files Browse the repository at this point in the history
…er (ydb-platform#11422)

Co-authored-by: Mikhail Montsev <[email protected]>
  • Loading branch information
SvartMetal and Mikhail Montsev authored Nov 8, 2024
1 parent 3d0d6db commit 30b722c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ydb/core/driver_lib/run/kikimr_services_initializers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ static TInterconnectSettings GetInterconnectSettings(const NKikimrConfig::TInter
try {
return TFileInput(*path).ReadAll();
} catch (const std::exception& ex) {
Cerr << "failed to read " << name << " file '" << *path << "': " << ex.what() << Endl;
exit(1);
ythrow yexception()
<< "failed to read " << name << " file '" << *path << "': " << ex.what();
}
}
return TString();
Expand Down Expand Up @@ -743,9 +743,9 @@ void TBasicServicesInitializer::InitializeServices(NActors::TActorSystemSetup* s
auto listener = new TInterconnectListenerTCP(
address, node.second.second, icCommon);
if (int err = listener->Bind()) {
Cerr << "Failed to set up IC listener on port " << node.second.second
<< " errno# " << err << " (" << strerror(err) << ")" << Endl;
exit(1);
ythrow yexception()
<< "Failed to set up IC listener on port " << node.second.second
<< " errno# " << err << " (" << strerror(err) << ")";
}
setup->LocalServices.emplace_back(MakeInterconnectListenerActorId(false), TActorSetupCmd(listener,
TMailboxType::ReadAsFilled, interconnectPoolId));
Expand All @@ -763,9 +763,9 @@ void TBasicServicesInitializer::InitializeServices(NActors::TActorSystemSetup* s
}
auto listener = new TInterconnectListenerTCP(address, info.GetPort(), icCommon);
if (int err = listener->Bind()) {
Cerr << "Failed to set up IC listener on port " << info.GetPort()
<< " errno# " << err << " (" << strerror(err) << ")" << Endl;
exit(1);
ythrow yexception()
<< "Failed to set up IC listener on port " << info.GetPort()
<< " errno# " << err << " (" << strerror(err) << ")";
}
setup->LocalServices.emplace_back(MakeInterconnectListenerActorId(true), TActorSetupCmd(listener,
TMailboxType::ReadAsFilled, interconnectPoolId));
Expand All @@ -779,9 +779,9 @@ void TBasicServicesInitializer::InitializeServices(NActors::TActorSystemSetup* s
icCommon->TechnicalSelfHostName = nodesManagerConfig.GetHost();
auto listener = new TInterconnectListenerTCP({}, nodesManagerConfig.GetPort(), icCommon);
if (int err = listener->Bind()) {
Cerr << "Failed to set up IC listener on port " << nodesManagerConfig.GetPort()
<< " errno# " << err << " (" << strerror(err) << ")" << Endl;
exit(1);
ythrow yexception()
<< "Failed to set up IC listener on port " << nodesManagerConfig.GetPort()
<< " errno# " << err << " (" << strerror(err) << ")";
}
setup->LocalServices.emplace_back(MakeInterconnectListenerActorId(true), TActorSetupCmd(listener,
TMailboxType::ReadAsFilled, interconnectPoolId));
Expand Down

0 comments on commit 30b722c

Please sign in to comment.