Merge pull request #43364 from azat/server-stacktrace-on-fail

Provide full stacktrace in case of uncaught exception during server startup
This commit is contained in:
Alexander Gololobov 2022-11-22 15:07:57 +01:00 committed by GitHub
commit 32d66659e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -262,6 +262,7 @@ void Keeper::defineOptions(Poco::Util::OptionSet & options)
}
int Keeper::main(const std::vector<std::string> & /*args*/)
try
{
Poco::Logger * log = &logger();
@ -473,6 +474,12 @@ int Keeper::main(const std::vector<std::string> & /*args*/)
return Application::EXIT_OK;
}
catch (...)
{
/// Poco does not provide stacktrace.
tryLogCurrentException("Application");
throw;
}
void Keeper::logRevision() const

View File

@ -647,6 +647,7 @@ static void sanityChecks(Server & server)
}
int Server::main(const std::vector<std::string> & /*args*/)
try
{
Poco::Logger * log = &logger();
@ -1848,6 +1849,12 @@ int Server::main(const std::vector<std::string> & /*args*/)
return Application::EXIT_OK;
}
catch (...)
{
/// Poco does not provide stacktrace.
tryLogCurrentException("Application");
throw;
}
std::unique_ptr<TCPProtocolStackFactory> Server::buildProtocolStackFromConfig(
const Poco::Util::AbstractConfiguration & config,