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 5 commits into from Jan 2, 2018

Conversation

Projects
None yet
3 participants
@martinbroadhurst
Contributor

martinbroadhurst commented Dec 28, 2017

I'm open to opinions as to whether SO_REUSEPORT should be the default or not.
Also, would appreciate some advice about unit testing this change.

@tilgovi

This comment has been minimized.

Collaborator

tilgovi commented Dec 28, 2017

I am slightly in favor of a False default. This option matters most for users seeking the performance benefits, I think. Those users may know that they want this and they are likely to read through the server options for tweaks. New users, however, can sometimes be killing and restarting their server over and over while testing out code in development and reusing the port can sometimes lead to having two instances of Gunicorn running on a development machine, serving different code. To minimize confusion, I would make it False by default. I'm open to arguments for True, though.

No strong opinion on how to test this.

@martinbroadhurst

This comment has been minimized.

Contributor

martinbroadhurst commented Dec 29, 2017

I agree with you about the default being False. I have changed the code accordingly.

@tilgovi

This looks great to me. Thank you for opening a PR. I'll give others a chance to weigh in on whether we want to test this at all, otherwise I'll merge in the next day or so.

@martinbroadhurst

This comment has been minimized.

Contributor

martinbroadhurst commented Dec 30, 2017

Thanks. I have updated the documentation.

reuse_port
~~~~~~~~~~
* ``--reuse-port``

This comment has been minimized.

@berkerpeksag

berkerpeksag Dec 30, 2017

Collaborator

Documentation for the new option will be generated automatically from gunicorn/config.py when you run make html in docs/ directory.

This comment has been minimized.

@martinbroadhurst

martinbroadhurst Dec 31, 2017

Contributor

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?

This comment has been minimized.

@berkerpeksag

berkerpeksag Dec 31, 2017

Collaborator

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 why make html didn't get the documentation in the desc attribute.

This comment has been minimized.

@martinbroadhurst

martinbroadhurst Dec 31, 2017

Contributor

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 changed chdir, user and group. I must have got the edit wrong. Sorry about that. It's all there now.

default = False
desc = """\
Set the ``SO_REUSEPORT`` flag on the listening socket.

This comment has been minimized.

@berkerpeksag

berkerpeksag Dec 30, 2017

Collaborator

Please add .. versionadded:: 19.8.

This comment has been minimized.

@tilgovi

tilgovi Dec 31, 2017

Collaborator

I always forget this and you always catch it. Thanks! :-D

@benoitc benoitc referenced this pull request Jan 2, 2018

Closed

release 19.8.0 #1634

@berkerpeksag

This comment has been minimized.

Collaborator

berkerpeksag commented Jan 2, 2018

The cause of build failure is https://github.com/landscapeio/prospector/issues/200. All tests passed and I don't think we need a test case for this since testing the actual change reliably would be hard.

@berkerpeksag berkerpeksag merged commit 6171ac4 into benoitc:master Jan 2, 2018

5 of 8 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
couverture-io/py26 Not all changes are covered
Details
couverture-io/py36 Not all changes are covered
Details
couverture-io/py27 Code coverage OK
Details
couverture-io/py34 Code coverage OK
Details
couverture-io/py35 Code coverage OK
Details
couverture-io/py36-dev Code coverage OK
Details
couverture-io/py37 Code coverage OK
Details
@berkerpeksag

This comment has been minimized.

Collaborator

berkerpeksag commented Jan 2, 2018

Thanks!

berkerpeksag added a commit to berkerpeksag/gunicorn that referenced this pull request Jan 11, 2018

fofanov pushed a commit to fofanov/gunicorn that referenced this pull request Mar 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment