From d0d40b36b306236428a764349dbff98d38cf7dbd Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Tue, 17 Mar 2026 22:57:20 +0100 Subject: zen hub port reuse (#850) - Feature: Added `--allow-port-probing` option to control whether zenserver searches for a free port on startup (default: true, automatically false when --dedicated is set) - Feature: Added new hub options for controlling provisioned storage server instances: - `--hub-instance-http` - HTTP server implementation for instances (asio/httpsys) - `--hub-instance-http-threads` - Number of HTTP connection threads per instance - `--hub-instance-corelimit` - Limit CPU concurrency per instance - Improvement: Hub now manages a deterministic port pool for provisioned instances allowing reuse of unused ports --- src/zenserver/config/config.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/zenserver/config/config.cpp') diff --git a/src/zenserver/config/config.cpp b/src/zenserver/config/config.cpp index 60ae93853..15f6f79f3 100644 --- a/src/zenserver/config/config.cpp +++ b/src/zenserver/config/config.cpp @@ -133,6 +133,7 @@ ZenServerConfiguratorBase::AddCommonConfigOptions(LuaConfig::Options& LuaOptions // server LuaOptions.AddOption("server.dedicated"sv, ServerOptions.IsDedicated, "dedicated"sv); + LuaOptions.AddOption("server.allowportprobing"sv, ServerOptions.AllowPortProbing, "allow-port-probing"sv); LuaOptions.AddOption("server.sentry.disable"sv, ServerOptions.SentryConfig.Disable, "no-sentry"sv); LuaOptions.AddOption("server.sentry.allowpersonalinfo"sv, ServerOptions.SentryConfig.AllowPII, "sentry-allow-personal-info"sv); LuaOptions.AddOption("server.sentry.dsn"sv, ServerOptions.SentryConfig.Dsn, "sentry-dsn"sv); @@ -223,8 +224,11 @@ ZenServerCmdLineOptions::AddCliOptions(cxxopts::Options& options, ZenServerConfi #endif options.add_options()("dedicated", - "Enable dedicated server mode", + "Enable dedicated server mode, disables '--allow-port-probing' and allocates more resources.", cxxopts::value(ServerOptions.IsDedicated)->default_value("false")); + options.add_options()("allow-port-probing", + "Allow searching for an available port, disabled if '--dedicated' is enabled.", + cxxopts::value(ServerOptions.AllowPortProbing)->default_value("true")); options.add_options()("d, debug", "Enable debugging", cxxopts::value(ServerOptions.IsDebug)->default_value("false")); options.add_options()("clean", "Clean out all state at startup", @@ -691,6 +695,7 @@ ZenServerConfiguratorBase::Configure(int argc, char* argv[]) } m_ServerOptions.HttpConfig.IsDedicatedServer = m_ServerOptions.IsDedicated; + m_ServerOptions.HttpConfig.AllowPortProbing = !m_ServerOptions.IsDedicated && m_ServerOptions.AllowPortProbing; } void -- cgit v1.2.3