-
Notifications
You must be signed in to change notification settings - Fork 42k
[proxier/ipvs] Disable graceful termination for UDP traffic #77802
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
[proxier/ipvs] Disable graceful termination for UDP traffic #77802
Conversation
|
Hi @lbernail. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/ok-to-test |
|
LGTM overall. cc @andrewsykim for review. |
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.
re: strings.ToLower(string(v1.ProtocolTCP)), v1.ProtocolTCP is mainly a type used by the Service API and is only applicable when comparing values in that resource. For comparing protocols from VirtualServer, we can probably use a separate constant for this.
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 personally think just rsToDelete.VirtualServer.Protocol == "tcp" is also fine, having a constant may not be necessary either :)
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 completely agree
I just changed it to "tcp"
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.
Does this also apply for SCTP?
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'm not familiar with SCTP so I chose to enable graceful termination for TCP only
I had a quick look at the protocol and it seems to include a handshake and a shutdown which should make connection tracking similar to TCP (so when a backend stops, the equivalent of a FIN is sent and the connection should be removed from the IPVS conntrack).
If you have a simple test scenario in mind I can look into it (the change is very simple we can simply do rsToDelete.VirtualServer.Protocol != "udp" instead)
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'm not super familiar with it either, was more asking in case you knew :P. I think handling this on case-by-case basis makes sense. We can revisit if it's a problem for SCTP. Going to give another pass at this PR some time tomorrow to make sure we're not missing any edge cases :)
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 put more thought into this, and I think to be safe, we should only follow this scenarios for protocols we know for sure run into issue (UDP). So rsToDelete.VirtualServer.Protocol != "udp" like you mentioned. Otherwise this could have unintended outcomes for sctp that we aren't aware of.
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.e. don't change the behavior for sctp unless we have a good reason.
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.
Let's do that. Not sure how to test it but I'm pretty sure SCTP will have real connection tracking
|
Is there a way to add a test? |
|
Are you sure about |
Yes, I thought that too, but it turns out the doc is either wrong or incomplete. I tested it and it works |
|
/test pull-kubernetes-kubemark-e2e-gce-big |
|
/lgtm Please squash the commits @lbernail |
4ed9a69 to
9ff0685
Compare
Sure, just did it |
|
/lgtm /approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lbernail, m1093782566 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
…2-upstream-release-1.12 Automated cherry pick of #77802 upstream release 1.12
…2-upstream-release-1.14 Automated cherry pick of #77802 upstream release 1.14
…2-upstream-release-1.13 Automated cherry pick of #77802 upstream release 1.13
What type of PR is this?
/kind bug
What this PR does / why we need it:
Disable graceful termination for non-TCP flows. The rational behind this is that with a high number of UDP connections (DNS or syslog for instance), stale UDP connections (to terminated/terminating backends) will be reused and fail (and if the load is high enough never expire).
This patch disables graceful termination for UDP. It is not perfect, but I believe it is much better. What happens is the following:
Which issue(s) this PR fixes:
Fixes #76664
Special notes for your reviewer:
I think in addition to that we should set much more aggressive UDP timeouts (5s? instead of the default: 300s) and make it configurable with a flag for specific use-case (I haven't seen a use case for long lived udp "connections" with very low amount of traffic).
I'm not a big fan of
strings.ToLower(string(v1.ProtocolTCP)). Any thoughts on this?Does this PR introduce a user-facing change?:
/assign @m1093782566
/sig network
/area IPVS