File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
postgresql/src/storages/postgres/detail Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -480,13 +480,18 @@ void ConnectionPool::TryCreateConnectionAsync() {
480480 auto conn_settings = conn_settings_.ReadCopy ();
481481 // Checking errors is more expensive than incrementing an atomic, so we
482482 // check it only if we can start a new connection.
483- if (recent_conn_errors_.GetStatsForPeriod (kRecentErrorPeriod , true ) < conn_settings.recent_errors_threshold ) {
483+ const auto recent_errors = recent_conn_errors_.GetStatsForPeriod (kRecentErrorPeriod , true );
484+ if (recent_errors < conn_settings.recent_errors_threshold ) {
484485 engine::SemaphoreLock size_lock{size_semaphore_, std::try_to_lock};
485486 if (size_lock || connect_task_storage_.ActiveTasksApprox () <= kPendingConnectsMax ) {
486487 connect_task_storage_.Detach (Connect (std::move (size_lock), std::move (conn_settings)));
487488 }
488489 } else {
489- LOG_DEBUG () << " Too many connection errors in recent period" ;
490+ LOG_LIMITED_WARNING (
491+ " Too many connection errors in recent period: {} >= {}" ,
492+ recent_errors,
493+ conn_settings.recent_errors_threshold
494+ );
490495 }
491496}
492497
You can’t perform that action at this time.
0 commit comments