Skip to content

Commit

Permalink
libovsdb: use exponential backoff
Browse files Browse the repository at this point in the history
Signed-off-by: zhangzujian <[email protected]>
  • Loading branch information
zhangzujian committed Sep 6, 2024
1 parent fd5ce31 commit 947a6f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/ovs/ovn-nb-suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,8 +780,13 @@ func newNbClient(addr string, timeout int) (client.Client, error) {
WithValues("database", dbModel.Name())
stdr.SetVerbosity(1)

bo := &backoff.ExponentialBackOff{
InitialInterval: time.Second,
Multiplier: 2,
MaxInterval: time.Minute,
}
options := []client.Option{
client.WithReconnect(time.Duration(timeout)*time.Second, &backoff.ZeroBackOff{}),
client.WithReconnect(time.Duration(timeout)*time.Second, bo),
client.WithLeaderOnly(false),
client.WithLogger(&logger),
}
Expand Down

0 comments on commit 947a6f4

Please sign in to comment.