More logs + build fix.

This commit is contained in:
Alexander Kuzmenkov 2019-09-26 15:08:24 +03:00
parent 2918324807
commit e864b6f338
3 changed files with 11 additions and 2 deletions

View File

@ -174,6 +174,7 @@ public:
{ {
int sig = 0; int sig = 0;
DB::readBinary(sig, in); DB::readBinary(sig, in);
LOG_TRACE(log, "Received signal " << sig);
if (sig == Signals::StopThread) if (sig == Signals::StopThread)
{ {
@ -790,7 +791,9 @@ void BaseDaemon::initializeTerminationAndSignalProcessing()
void BaseDaemon::logRevision() const void BaseDaemon::logRevision() const
{ {
Logger::root().information("Starting " + std::string{VERSION_FULL} + " with revision " + std::to_string(ClickHouseRevision::get())); Logger::root().information("Starting " + std::string{VERSION_FULL}
+ " with revision " + std::to_string(ClickHouseRevision::get())
+ ", PID " + std::to_string(getpid()));
} }
/// Makes server shutdown if at least one Poco::Task have failed. /// Makes server shutdown if at least one Poco::Task have failed.

View File

@ -127,6 +127,8 @@ void ODBCBridge::initialize(Application & self)
buildLoggers(config(), logger(), self.commandName()); buildLoggers(config(), logger(), self.commandName());
BaseDaemon::logRevision();
log = &logger(); log = &logger();
hostname = config().getString("listen-host", "localhost"); hostname = config().getString("listen-host", "localhost");
port = config().getUInt("http-port"); port = config().getUInt("http-port");
@ -139,7 +141,11 @@ void ODBCBridge::initialize(Application & self)
initializeTerminationAndSignalProcessing(); initializeTerminationAndSignalProcessing();
#if USE_POCO_SQLODBC || USE_POCO_DATAODBC
// It doesn't make much sense to build this bridge without ODBC, but we
// still do this.
Poco::Data::ODBC::Connector::registerConnector(); Poco::Data::ODBC::Connector::registerConnector();
#endif
ServerApplication::initialize(self); // NOLINT ServerApplication::initialize(self); // NOLINT
} }

View File

@ -50,7 +50,7 @@ ShellCommand::~ShellCommand()
{ {
if (terminate_in_destructor) if (terminate_in_destructor)
{ {
LOG_TRACE(getLogger(), "Will kill shell command pid " << pid << "(' << ') with SIGTERM"); LOG_TRACE(getLogger(), "Will kill shell command pid " << pid << " with SIGTERM");
int retcode = kill(pid, SIGTERM); int retcode = kill(pid, SIGTERM);
if (retcode != 0) if (retcode != 0)
LOG_WARNING(getLogger(), "Cannot kill shell command pid " << pid << " errno '" << errnoToString(retcode) << "'"); LOG_WARNING(getLogger(), "Cannot kill shell command pid " << pid << " errno '" << errnoToString(retcode) << "'");