Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions plugins/meta/vrf/vrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ CONTINUE:
}

// Waits for global IPV6 addresses to be added by the kernel.
maxRetry := 10
for {
backoffBase := 10 * time.Millisecond
maxRetries := 8
for retryCount := 0; retryCount <= maxRetries; retryCount++ {
routesVRFTable, err := netlinksafe.RouteListFiltered(
netlink.FAMILY_ALL,
&netlink.Route{
Expand All @@ -178,12 +179,13 @@ CONTINUE:
break
}

maxRetry--
if maxRetry <= 0 {
if retryCount == maxRetries {
return fmt.Errorf("failed getting local/host addresses for %s in table %d with dst %s", intf, vrf.Table, toFind.IPNet.String())
}

time.Sleep(10 * time.Millisecond)
// Exponential backoff - 10ms, 20m, 40ms, 80ms, 160ms, 320ms, 640ms, 1280ms
// Approx 2,5 seconds total
time.Sleep(backoffBase * time.Duration(1<<retryCount))
}
}

Expand Down