From bc1e34be0b4e99052846b6def2c8a169db97db1d Mon Sep 17 00:00:00 2001 From: Ayush Mehra <97939637+amehra-ni@users.noreply.github.com> Date: Tue, 3 Dec 2024 12:08:46 +0530 Subject: [PATCH] handle null (#1135) Bypassing as this is blocking ATS runs. Simple fix to make sideband_port optional config. --- source/server/server_configuration_parser.cpp | 7 ++++++- source/server/server_configuration_parser.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/server/server_configuration_parser.cpp b/source/server/server_configuration_parser.cpp index 96feb1ebb..01571c2a3 100644 --- a/source/server/server_configuration_parser.cpp +++ b/source/server/server_configuration_parser.cpp @@ -144,7 +144,12 @@ int ServerConfigurationParser::parse_max_message_size() const int ServerConfigurationParser::parse_sideband_port() const { - return parse_port_with_key(kSidebandPortJsonKey); + try { + return parse_port_with_key(kSidebandPortJsonKey); + } + catch (const UnspecifiedPortException&) { + return DEFAULT_SIDEBAND_PORT; + } } FeatureToggles ServerConfigurationParser::parse_feature_toggles() const diff --git a/source/server/server_configuration_parser.h b/source/server/server_configuration_parser.h index 6ef631b84..aaa37329a 100644 --- a/source/server/server_configuration_parser.h +++ b/source/server/server_configuration_parser.h @@ -23,6 +23,7 @@ static const char* kInvalidFeatureToggleMessage = "Feature Toggles must be speci static const char* kInvalidCodeReadinessMessage = "code_readiness must be a string in [Release, RestrictedRelease, NextRelease, RestrictedNextRelease, Incomplete, Prototype].\n\n"; static const char* kDefaultAddress = "[::]"; constexpr int UNLIMITED_MAX_MESSAGE_SIZE = -1; +constexpr int DEFAULT_SIDEBAND_PORT = 50055; class ServerConfigurationParser { public: