diff options
author | Xavier Hernandez <jahernan@redhat.com> | 2018-01-19 12:18:13 +0100 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2019-05-11 14:25:53 +0000 |
commit | 59841f7e1ff0511b04884015441a181a56d07bea (patch) | |
tree | 7b4f16752014cf0cfc0ba1aad1847a43325e28a9 /rpc/rpc-lib/src/rpc-clnt.h | |
parent | da4601d536da761ce908a2461a0930857f99f171 (diff) |
rpc: implement reconnect back-off strategy
When a connection failure happens, gluster tries to reconnect every 3
seconds. In some cases the failure is spurious, so a delay of 3 seconds
could be unnecessarily long.
This patch implements a back-off strategy that tries a reconnect as soon
as 1 tenth of a second. If this fails, the time is doubled until it's
around 3 seconds. After that, the reconnect is attempted every 3 seconds
as before.
Change-Id: Icb3fbe20d618f50cbbb599dce542b4e871c22149
Updates: bz#1193929
Signed-off-by: Xavier Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'rpc/rpc-lib/src/rpc-clnt.h')
-rw-r--r-- | rpc/rpc-lib/src/rpc-clnt.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.h b/rpc/rpc-lib/src/rpc-clnt.h index b46feed50c8..2c252d5ff86 100644 --- a/rpc/rpc-lib/src/rpc-clnt.h +++ b/rpc/rpc-lib/src/rpc-clnt.h @@ -136,6 +136,7 @@ struct rpc_clnt_connection { struct saved_frames *saved_frames; struct timespec last_sent; struct timespec last_received; + struct timespec reconnect_delay; uint64_t pingcnt; uint64_t msgcnt; uint64_t cleanup_gen; |