-
Notifications
You must be signed in to change notification settings - Fork 386
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
Fix error loop caused by failure to delete a non-existing route #3827
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3827 +/- ##
==========================================
+ Coverage 38.20% 46.14% +7.94%
==========================================
Files 114 247 +133
Lines 15688 35914 +20226
==========================================
+ Hits 5993 16572 +10579
- Misses 9215 17704 +8489
- Partials 480 1638 +1158
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
In the commit message:
The error will trigger the event of delete the LoadBalancer again, obviously,
delete -> deleting or just "trigger LoadBalancer deletion again"
obviously -> and obviously
pkg/agent/route/route_linux.go
Outdated
@@ -1298,9 +1298,10 @@ func (c *Client) deleteLoadBalancerIngressIPRoute(svcIPStr string) error { | |||
|
|||
route := generateRoute(svcIP, mask, gw, linkIndex, netlink.SCOPE_UNIVERSE) | |||
if err := netlink.RouteDel(route); err != nil { | |||
return fmt.Errorf("failed to delete routing entry for LoadBalancer ingress IP %s: %w", svcIP.String(), err) | |||
klog.Warningf("Failed to delete routing entry for LoadBalancer ingress IP %s: %w", svcIP.String(), err) |
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.
We should be able to check and ignore only the not-found/exist error?
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.
I think we can log not-found/exist error.
07c9930
to
3b05037
Compare
3b05037
to
58051d7
Compare
When a LoadBalancer with ingress IP is created, corresponding route for the ingress IP is also installed. When deleting the LoadBalancer, corresponding route should be also uninstalled. Before uninstalling the route, if the route is removed, then deleting the route will get a failure and return an error. The error will trigger LoadBalancer deletion again, and obviously, deleting the route will get a failure and return an error another time, resulting in an error loop. This PR fixes error loop by printing log instead of returning error when getting the error "no such process" (such error means that the route expected to be deleted doesn't exist). Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
58051d7
to
d99e856
Compare
/test-all |
/test-ipv6-e2e |
/test-e2e |
When a LoadBalancer with ingress IP is created, corresponding route
for the ingress IP is also installed. When deleting the LoadBalancer,
corresponding route should be also uninstalled. Before uninstalling
the route, if the route is removed, then deleting the route will
get a failure and return an error. The error will trigger LoadBalancer
deletion again, and obviously, deleting the route will get a failure
and return an error another time, resulting in an error loop. This PR
fixes error loop by printing log instead of returning error when getting
the error "no such process" (such error means that the route expected to
be deleted doesn't exist).
Signed-off-by: Hongliang Liu lhongliang@vmware.com