Skip to content

Commit

Permalink
feat mongo: set default conn_timeout to 100ms
Browse files Browse the repository at this point in the history
commit_hash:ae404fb2ca3c574c969213f148f5a9d2d21ea37d
  • Loading branch information
segoon committed Nov 15, 2024
1 parent 7923884 commit 73ed45f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions mongo/include/userver/storages/mongo/component.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace components {
/// mongo-taxi:
/// dbalias: taxi
/// appname: userver-sample
/// conn_timeout: 2s
/// conn_timeout: 100ms
/// so_timeout: 10s
/// queue_timeout: 1s
/// initial_size: 16
Expand All @@ -53,7 +53,7 @@ namespace components {
/// dbalias | name of the database in secdist config (if available) | --
/// dbconnection | connection string (used if no dbalias specified) | --
/// appname | application name for the DB server | userver
/// conn_timeout | connection timeout | 2s
/// conn_timeout | connection timeout | 100ms
/// so_timeout | socket timeout | 10s
/// queue_timeout | max connection queue wait time | 1s
/// initial_size | number of connections created initially | 16
Expand Down Expand Up @@ -139,7 +139,7 @@ inline constexpr bool kHasValidate<Mongo> = true;
/// ```
/// multi-mongo:
/// appname: userver-sample
/// conn_timeout: 2s
/// conn_timeout: 100ms
/// so_timeout: 10s
/// queue_timeout: 1s
/// initial_size: 16
Expand All @@ -154,7 +154,7 @@ inline constexpr bool kHasValidate<Mongo> = true;
/// Name | Description | Default value
/// ---- | ----------- | -------------
/// appname | application name for the DB server | userver
/// conn_timeout | connection timeout | 2s
/// conn_timeout | connection timeout | 100ms
/// so_timeout | socket timeout | 10s
/// queue_timeout | max connection queue wait time | 1s
/// initial_size | number of connections created initially (per database) | 16
Expand Down
2 changes: 1 addition & 1 deletion mongo/include/userver/storages/mongo/pool_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct PoolConfig final {
};

/// Default connection timeout
static constexpr auto kDefaultConnTimeout = std::chrono::seconds{2};
static constexpr auto kDefaultConnTimeout = std::chrono::milliseconds{100};
/// Default socket timeout
static constexpr auto kDefaultSoTimeout = std::chrono::seconds{10};
/// Default connection queue timeout
Expand Down
2 changes: 1 addition & 1 deletion mongo/src/storages/mongo/component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ additionalProperties: false
conn_timeout:
type: string
description: connection timeout
defaultDescription: 2s
defaultDescription: 100ms
so_timeout:
type: string
description: socket timeout
Expand Down

0 comments on commit 73ed45f

Please sign in to comment.