-
-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
gh-124761: add socket.SO_REUSEPORT_LB #124961
base: main
Are you sure you want to change the base?
Conversation
graingert
commented
Oct 4, 2024
•
edited by bedevere-app
bot
Loading
edited by bedevere-app
bot
- Issue: Add socket.SO_REUSEPORT_LB and use it in socket.create_server(reuse_port=True) and BaseEventLoop.create_server(reuse_port=True) #124761
this is only half of the work as the flag needs to be used when reuse_port=True is passed to various apis |
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 PR for SO_ORIGINAL_DST
that I just reviewed, I didn't really feel the need to document it since we don't really document every constant (and it was better to have the constant included without going through a round of documentation review).
Here, since it's FreeBSD-only I think it's nice to document it (SO_ORIGINAL_DST
is exposed assuming some headers, which would probably make its docs a bit messy I think). Since there's no conditional header, I appreciate the additional documentation.
Note: I haven't thought about it but we could have actually added some .. versionadded
to the SO_*
entries though for SO_ORIGINAL_DST
.
I'd also like @erlend-aasland's review on this one if possible.
@@ -0,0 +1 @@ | |||
Add ``SO_REUSEPORT_LB`` constant to :mod:`socket` for FreeBSD. |
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.
Add ``SO_REUSEPORT_LB`` constant to :mod:`socket` for FreeBSD. | |
Add :data:`~socket.SO_REUSEPORT_LB` constant to :mod:`socket` for FreeBSD. |
@@ -674,6 +674,14 @@ Constants | |||
|
|||
.. availability:: Linux >= 3.9 | |||
|
|||
.. data:: SO_REUSEPORT_LB | |||
|
|||
Constant to enable duplicate address and port bindings with load balancing. |
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.
Should SO_REUSEPORT_LB
be preferred on FreeBSD instead of SO_REUSEPORT
?
|
||
.. versionadded:: 3.14 | ||
|
||
.. availability:: FreeBSD. |
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.
Could we specify the minimal FreeBSD version?