Skip to content

Commit 9ad880a

Browse files
authored
CXXCBC-359: Reduce default HTTP idle timeout (#448)
1 parent 02d5a1a commit 9ad880a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

core/cluster.hxx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,13 @@ class cluster : public std::enable_shared_from_this<cluster>
336336
template<typename Handler>
337337
void do_open(Handler&& handler)
338338
{
339+
// Warn users if idle_http_connection_timeout is too close to server idle timeouts
340+
if (origin_.options().idle_http_connection_timeout > std::chrono::milliseconds(4'500)) {
341+
CB_LOG_INFO("[{}]: The SDK may produce trivial warnings due to the idle HTTP connection timeout being set above the idle"
342+
"timeout of various services",
343+
id_);
344+
}
345+
339346
// Warn users if they attempt to use Capella without TLS being enabled.
340347
bool has_capella_host = false;
341348
{

core/timeout_defaults.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ constexpr std::chrono::milliseconds tcp_keep_alive_interval{ 60'000 };
4040
constexpr std::chrono::milliseconds config_poll_interval{ 2'500 };
4141
constexpr std::chrono::milliseconds config_poll_floor{ 50 };
4242
constexpr std::chrono::milliseconds config_idle_redial_timeout{ 5 * 60'000 };
43-
constexpr std::chrono::milliseconds idle_http_connection_timeout{ 4'500 };
43+
constexpr std::chrono::milliseconds idle_http_connection_timeout{ 1'000 };
4444
} // namespace couchbase::core::timeout_defaults

0 commit comments

Comments
 (0)