Merge pull request #28027 from ClickHouse/fix-throw-without-exception-in-mysql

Fix throw without exception in MySQL source.
This commit is contained in:
Nikolai Kochetov 2021-08-24 10:13:12 +03:00 committed by GitHub
commit 3db619cffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,12 +100,12 @@ void MySQLWithFailoverSource::onStart()
catch (const mysqlxx::ConnectionLost & ecl) /// There are two retriable failures: CR_SERVER_GONE_ERROR, CR_SERVER_LOST
{
LOG_WARNING(log, "Failed connection ({}/{}). Trying to reconnect... (Info: {})", count_connect_attempts, settings->default_num_tries_on_connection_loss, ecl.displayText());
}
if (++count_connect_attempts > settings->default_num_tries_on_connection_loss)
{
LOG_ERROR(log, "Failed to create connection to MySQL. ({}/{})", count_connect_attempts, settings->default_num_tries_on_connection_loss);
throw;
if (++count_connect_attempts > settings->default_num_tries_on_connection_loss)
{
LOG_ERROR(log, "Failed to create connection to MySQL. ({}/{})", count_connect_attempts, settings->default_num_tries_on_connection_loss);
throw;
}
}
}