Skip to content
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

Update docs for low_latency option and fix parsing issue #2631

Conversation

seangoedecke
Copy link
Contributor

@seangoedecke seangoedecke commented May 18, 2021

Description

Closes #2623

As well as updating the docs to reflect that TCP_NODELAY is off by default, I've tweaked the code so that low_latency=false doesn't set TCP_NODELAY, which is consistent with how other options are parsed. Let me know if the tests are a bit overkill.

I'm not sure how best to test that the created socket has or lacks TCP_NODELAY in JRuby, since this version of JRuby has a very minimal Socket implementation (no constants, no bool method). For now I've skipped my new tests if we're running them in JRuby, but any guidance would be appreciated.

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

Previously the binder.parse code was just checking that the low_latency
key existed, but the docs (and other options) support passing options in
the format `option=false`. This commit now treats `low_latency=false` as
false, while still treating `low_latency` with no `=` as true
JRuby (at least this version) doesn't support basic Socket constants or
methods

Ref: jruby/jruby#3438
@nateberkopec nateberkopec merged commit 8c211dc into puma:master May 20, 2021
@nateberkopec
Copy link
Member

Cheers and thanks for your contributions 🎉

JuanitoFatas pushed a commit to JuanitoFatas/puma that referenced this pull request Sep 9, 2022
* Treat low_latency=false as false instead of true

Previously the binder.parse code was just checking that the low_latency
key existed, but the docs (and other options) support passing options in
the format `option=false`. This commit now treats `low_latency=false` as
false, while still treating `low_latency` with no `=` as true

* Update docs to reflect code behaviour

* Skip getsockopt tests in JRuby

JRuby (at least this version) doesn't support basic Socket constants or
methods

Ref: jruby/jruby#3438
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TCP server socket not optimized for low latency by default, contradicting docs
2 participants