-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 SO_REUSEPORT support for EntryPoints #9834
Conversation
I tested this PR. |
Hello @aofei, I can see that the update of the static configuration references files is missing:
Can you please update them? |
Hi @rtribotte! I have just updated those two files and rebased my branch as well. |
Also, should I change the base branch of this PR from |
@aofei Thanks for the changes!
For now, I don't know, I'm going to raise a discussion with other maintainers on that subject and let you know. |
Hello @aofei, I came across this article mentioning limitations associated with the SO_REUSEPORT directive, especially the closing of connections by the kernel when one of the processes using the port exits:
I'm hoping to get your insights, but so far, these limitations could be a significant concern for Traefik users, at least I think this should be documented. |
@aofei So, as a follow-up, yes please, if you can rebase this PR on the v3.0 branch it would be great, we would like to have it for v3. |
@rtribotte Yes, you're right, thanks for bringing it up! It's a known bug in the SO_REUSEPORT implementation of the Linux kernel. In case anyone else is interested, the problem mentioned by @rtribotte is that when a listening process exits, all incoming TCP connections assigned to it that are either in the middle of a 3WH (3-way handshake) or in the accept queue get closed, even if other processes could handle them. The root cause of this problem is that once the kernel assigns an incoming connection to a specific process (triggered by the arrival of the initial A common workaround is to pass the listener file descriptors between different processes without closing them. For example, Nginx does this, thanks to its concept of worker processes. Unfortunately, this doesn't work with Traefik, as Traefik is a single process. While this is a problem, it doesn't make SO_REUSEPORT a bad feature. It's a kernel bug, until it's resolved or a workaround is found, I agree that it should be documented. |
@rtribotte I have updated the |
Hey @aofei, It seems that you have conflicts, could you fix them? |
Hi @nmengin! Thanks for letting me know about the conflicts. They occurred after my last commit, so I didn't notice. They have now been fixed. |
Hey @aofei, Thank you for your quick answer and action. |
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 this contribution!
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.
LGTM 👏
Thank you @aofei 👍
@kevinpollet @rtribotte I just made the changes you requested. Please let me know if I've got something wrong. |
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 👍
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!
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.
LGTM
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.
LGTM
What does this PR do?
Add SO_REUSEPORT support for EntryPoints.
Motivation
Attempts to solve the problem of canary deployment against Traefik itself.
Fixes #9823
More
Additional Notes
This PR only focuses on the implementation. For discussion, please move to #9823.