-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make SO_REUSEPORT Optional #1669
Merged
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
da9546b
Add config variable for SO_REUSEPORT and use it when setting socket o…
martinbroadhurst bfb3999
Make the default for the use of SO_REUSEPORT FALSE
martinbroadhurst 283abb5
Add reuse_port to documentation
martinbroadhurst 06c3227
Add versionadded to reuse-port
martinbroadhurst 16b315a
Update documentation for reuse_port
martinbroadhurst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,6 +204,10 @@ def sendfile(self): | |
|
||
return True | ||
|
||
@property | ||
def reuse_port(self): | ||
return self.settings['reuse_port'].get() | ||
|
||
@property | ||
def paste_global_conf(self): | ||
raw_global_conf = self.settings['raw_paste_global_conf'].get() | ||
|
@@ -953,6 +957,18 @@ class Sendfile(Setting): | |
added support for the ``SENDFILE`` environment variable | ||
""" | ||
|
||
class ReusePort(Setting): | ||
name = "reuse_port" | ||
section = "Server Mechanics" | ||
cli = ["--reuse-port"] | ||
validator = validate_bool | ||
action = "store_true" | ||
default = False | ||
|
||
desc = """\ | ||
Set the ``SO_REUSEPORT`` flag on the listening socket. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I always forget this and you always catch it. Thanks! :-D |
||
""" | ||
|
||
|
||
class Chdir(Setting): | ||
name = "chdir" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Documentation for the new option will be generated automatically from
gunicorn/config.py
when you runmake html
indocs/
directory.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 sure I understand your comment, @berkerpeksag. I generated this change by running
make -C docs html
. Am I not supposed to commit settings.rst?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 thought you manually edited it because I didn't see the "Set the
SO_REUSEPORT
flag on the listening socket." part in the generated file. Now I don't know whymake html
didn't get the documentation in thedesc
attribute.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 generated it, but then edited it because running it also brought in
logconfig_dict
(which presumably was omitted previously and should be in its own PR), and also changedchdir
,user
andgroup
. I must have got the edit wrong. Sorry about that. It's all there now.