Skip to content

Commit 429e1d2

Browse files
committed
CCBC-1608: reduce timeout for idle HTTP connections to 1 second
Change-Id: I00292dc99feb66953a2dc44485102f17bbcc78b4 Reviewed-on: https://review.couchbase.org/c/libcouchbase/+/197341 Reviewed-by: Jared Casey <[email protected]> Tested-by: Build Bot <[email protected]>
1 parent 82eaeaf commit 429e1d2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/instance.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ lcb_STATUS lcb_create(lcb_INSTANCE **instance, const lcb_CREATEOPTS *options)
566566
// Needs its own scope because there are prior GOTOs
567567
io::Pool::Options pool_opts;
568568
pool_opts.maxidle = 1;
569-
pool_opts.tmoidle = LCB_MS2US(10000); // 10 seconds
569+
pool_opts.tmoidle = LCB_DEFAULT_HTTP_POOL_TIMEOUT;
570570
obj->memd_sockpool->set_options(pool_opts);
571571
obj->http_sockpool->set_options(pool_opts);
572572
}

src/settings.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@
114114

115115
#define LCB_DEFAULT_PERSISTENCE_TIMEOUT_FLOOR 1500000
116116

117+
/* 1 second */
118+
#define LCB_DEFAULT_HTTP_POOL_TIMEOUT LCB_MS2US(1000)
119+
117120
#include "config.h"
118121
#include <libcouchbase/couchbase.h>
119122
#include <libcouchbase/metrics.h>

0 commit comments

Comments
 (0)