Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: fix exception when no tcp and http server created #7281

Merged
merged 5 commits into from
Apr 12, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions dbms/src/Server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ class Server::TcpHttpServersHolder
LOG_INFO(log, "tcp_port is closed because tls config is set");
}

/// TCP with SSL
/// TCP with SSL (Not supported yet)
if (config.has("tcp_port_secure") && !security_config->hasTlsConfig())
{
#if Poco_NetSSL_FOUND
Expand Down Expand Up @@ -655,9 +655,8 @@ class Server::TcpHttpServersHolder
LOG_INFO(log, "tcp_port_secure is closed because tls config is set");
}

/// TCP servers must be created.
if (servers.empty())
throw Exception("No 'tcp_port' and 'http_port' is specified in configuration file.", ErrorCodes::NO_ELEMENTS_IN_CONFIG);
LOG_WARNING(log, "No TCP and HTTP servers are created");
}
catch (const Poco::Net::NetException & e)
{
Expand All @@ -677,11 +676,7 @@ class Server::TcpHttpServersHolder
throw;
}
}

if (servers.empty())
throw Exception("No servers started (add valid listen_host and 'tcp_port' or 'http_port' to configuration file.)",
ErrorCodes::NO_ELEMENTS_IN_CONFIG);


for (auto & server : servers)
server->start();
}
Expand Down