2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

reconnect: Add ability to do a number of retries without backoff.

This is aimed at an upcoming database clustering implementation, where it's
desirable to try all of the cluster members quickly before backing off to
retry them again in sequence.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
This commit is contained in:
Ben Pfaff
2018-01-22 11:04:58 -08:00
parent f70b61d33d
commit 5ee527e223
6 changed files with 145 additions and 36 deletions

View File

@@ -104,6 +104,10 @@ def do_set_max_tries(arg):
r.set_max_tries(int(arg))
def do_set_backoff_free_tries(arg):
r.set_backoff_free_tries(int(arg))
def diff_stats(old, new, delta):
if (old.state != new.state or
old.state_elapsed != new.state_elapsed or
@@ -173,6 +177,7 @@ def main():
"advance": do_advance,
"timeout": do_timeout,
"set-max-tries": do_set_max_tries,
"set-backoff-free-tries": do_set_backoff_free_tries,
"passive": do_set_passive,
"listening": do_listening,
"listen-error": do_listen_error