aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Montsev <svartmetal@yandex-team.com>2024-11-08 17:38:10 +0000
committerGitHub <noreply@github.com>2024-11-08 18:38:10 +0100
commit30b722c88f38e483c21dc542bc5c01c88c3953ef (patch)
tree0cb66387e7ee50fffd6dc355121d169fe5fe3264
parent3d0d6dba78a90dbc2d734ea1642d02ee27b95629 (diff)
downloadydb-30b722c88f38e483c21dc542bc5c01c88c3953ef.tar.gz
Throw exception instead of calling exit(1) in TBasicServicesInitializer (#11422)
Co-authored-by: Mikhail Montsev <svartmetal@github.com>
-rw-r--r--ydb/core/driver_lib/run/kikimr_services_initializers.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
index 23023059c63..757c85ab3cc 100644
--- a/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
+++ b/ydb/core/driver_lib/run/kikimr_services_initializers.cpp
@@ -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();
@@ -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));
@@ -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));
@@ -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));