summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/socket/src/socket.h
diff options
context:
space:
mode:
authorMilind Changire <mchangir@redhat.com>2017-06-06 12:42:40 +0530
committerRaghavendra Talur <rtalur@redhat.com>2017-06-20 04:58:25 +0000
commitcf1f33a261b093a5cdb17406f3bc8e301caf9581 (patch)
treeebd98fa4a0ee29aa42edc8a73db85394260acfef /rpc/rpc-transport/socket/src/socket.h
parentf05dd5d6d9b8953bf97c70148bae8eadc68b5c24 (diff)
rpc: add options to manage socket keepalive lifespan
Problem: Default values for handling socket timeouts for brick responses are insufficient for aggressive applications such as databases. Solution: Add 1:1 gluster options for keepalive, keepalive-idle, keepalive-interval and keepalive-timeout as per the socket level options available as per tcp(7) man page. Default values for options are NOT agressive and continue to be values which result in default timeout when only the keep alive option is turned on. These options are Linux specific and will not be applicable to the *BSDs. mainline: > BUG: 1426059 > Signed-off-by: Milind Changire <mchangir@redhat.com> > Reviewed-on: https://review.gluster.org/16731 > Smoke: Gluster Build System <jenkins@build.gluster.org> > CentOS-regression: Gluster Build System <jenkins@build.gluster.org> > NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> > Reviewed-by: Raghavendra G <rgowdapp@redhat.com> (cherry picked from commit 6b8df081b46ac4f485c86a5052fc30472e74bfbb) Change-Id: I2a08ecd949ca8ceb3e090d336ad634341e2dbf14 BUG: 1452038 Signed-off-by: Milind Changire <mchangir@redhat.com> Reviewed-on: https://review.gluster.org/17330 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Talur <rtalur@redhat.com>
Diffstat (limited to 'rpc/rpc-transport/socket/src/socket.h')
-rw-r--r--rpc/rpc-transport/socket/src/socket.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.h b/rpc/rpc-transport/socket/src/socket.h
index 8528bdeba8d..6c8875f7fb7 100644
--- a/rpc/rpc-transport/socket/src/socket.h
+++ b/rpc/rpc-transport/socket/src/socket.h
@@ -50,6 +50,10 @@
#define GF_MIN_SOCKET_WINDOW_SIZE (0)
#define GF_USE_DEFAULT_KEEPALIVE (-1)
+#define GF_KEEPALIVE_TIME (20)
+#define GF_KEEPALIVE_INTERVAL (2)
+#define GF_KEEPALIVE_COUNT (9)
+
typedef enum {
SP_STATE_NADA = 0,
SP_STATE_COMPLETE,
@@ -224,6 +228,7 @@ typedef struct {
int keepalive;
int keepaliveidle;
int keepaliveintvl;
+ int keepalivecnt;
int timeout;
uint32_t backlog;
gf_boolean_t read_fail_log;