-
Notifications
You must be signed in to change notification settings - Fork 737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add retry for plumbing route entry #223
Conversation
retry, maxRetryRouteAdd) | ||
time.Sleep(retryRouteAddInterval) | ||
} else if isRouteExistsError(err) { | ||
if err := netlink.RouteReplace(&r); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this replace works, shouldn't we just break
the loop and log a success?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!
940cae9
to
b7bc3b5
Compare
if err := netlink.RouteReplace(&r); err != nil { | ||
return errors.Wrapf(err, "eni network setup: unable to replace route entry %s", r.Dst.IP.String()) | ||
} | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a debug log as well? Something like
log.Debugf("Successfully replaced route to be %s/0", r.Dst.IP.String())
r.Dst.IP.String(), gw.IP.String(), eniTable) | ||
} | ||
} else { | ||
log.Debugf("Successfully added route route %s/0 via %s table %d", r.Dst.IP.String(), gw.IP.String(), eniTable) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"route" is there twice.
b7bc3b5
to
0605376
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes, LGTM!
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.