Skip to content

Commit

Permalink
Merge pull request ClickHouse#56648 from jsc0218/TunePGConnParameter
Browse files Browse the repository at this point in the history
Reset PG's conn timeout and try times to avoid endless wait for unavailable URLs
  • Loading branch information
alexey-milovidov authored Nov 14, 2023
2 parents c48dc82 + 9194f77 commit beb0f6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Core/PostgreSQL/PoolWithFailover.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

static constexpr inline auto POSTGRESQL_POOL_DEFAULT_SIZE = 16;
static constexpr inline auto POSTGRESQL_POOL_WAIT_TIMEOUT = 5000;
static constexpr inline auto POSTGRESQL_POOL_WITH_FAILOVER_DEFAULT_MAX_TRIES = 5;
static constexpr inline auto POSTGRESQL_POOL_WITH_FAILOVER_DEFAULT_MAX_TRIES = 2;

namespace postgres
{
Expand Down
2 changes: 1 addition & 1 deletion src/Core/PostgreSQL/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ConnectionInfo formatConnectionString(String dbname, String host, UInt16 port, S
<< " port=" << port
<< " user=" << DB::quote << user
<< " password=" << DB::quote << password
<< " connect_timeout=10";
<< " connect_timeout=2";
return {out.str(), host + ':' + DB::toString(port)};
}

Expand Down

0 comments on commit beb0f6c

Please sign in to comment.