Skip to content
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

Merged
merged 1 commit into from
Nov 12, 2018

Conversation

liwenwu-amazon
Copy link
Contributor

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.

retry, maxRetryRouteAdd)
time.Sleep(retryRouteAddInterval)
} else if isRouteExistsError(err) {
if err := netlink.RouteReplace(&r); err != nil {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch!

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
Copy link
Contributor

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"route" is there twice.

Copy link
Contributor

@mogren mogren left a 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!

@liwenwu-amazon liwenwu-amazon merged commit 15a69f2 into aws:master Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants