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

8289291: HttpServer sets incorrect value for "max" parameter in Keep-Alive header value #9326

Closed
wants to merge 2 commits into from

Conversation

jaikiran
Copy link
Member

@jaikiran jaikiran commented Jun 29, 2022

Can I please get a review for this change which addresses https://bugs.openjdk.org/browse/JDK-8289291?

As noted in that issue, right now, the Http(s)Server sets an incorrect value for the max parameter of the Keep-Alive header. The max value is supposed to be the number of subsequent requests that the server is willing to serve over that specific connection. The current value it sets is instead the number of idle connections that are configured for the server.

The commit in this PR removes that max parameter altogether, since it isn't mandated by the spec, nor does the Http(s)Server have any specific construct to come up with a right value. Furthermore, on the client side the HttpURLConnection based client doesn't mandate the presence of this parameter in the Keep-Alive header. So this change won't cause any regressions in that area.

tier1, tier2 and tier3 testing passed without any related issues after this change.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8289291: HttpServer sets incorrect value for "max" parameter in Keep-Alive header value

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/9326/head:pull/9326
$ git checkout pull/9326

Update a local copy of the PR:
$ git checkout pull/9326
$ git pull https://git.openjdk.org/jdk pull/9326/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9326

View PR using the GUI difftool:
$ git pr show -t 9326

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/9326.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 29, 2022

👋 Welcome back jpai! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 29, 2022
@openjdk
Copy link

openjdk bot commented Jun 29, 2022

@jaikiran The following label will be automatically applied to this pull request:

  • net

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the net net-dev@openjdk.org label Jun 29, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 29, 2022

Webrevs

Copy link
Member

@Michael-Mc-Mahon Michael-Mc-Mahon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code change looks fine. Could we add a test (even to an existing keepalive one) to verify that "max" is no longer sent?

@jaikiran
Copy link
Member Author

Could we add a test (even to an existing keepalive one) to verify that "max" is no longer sent?

Done. I've updated the PR to include a new test which verifies the absence of the max parameter in the Keep-Alive response header. The test fails without the fix in this PR and passes with the fix.

Copy link
Member

@Michael-Mc-Mahon Michael-Mc-Mahon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. Thanks!

@openjdk
Copy link

openjdk bot commented Jun 29, 2022

@jaikiran This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8289291: HttpServer sets incorrect value for "max" parameter in Keep-Alive header value

Reviewed-by: michaelm, dfuchs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 4 new commits pushed to the master branch:

  • 0709a6a: 8284942: Proxy building can just iterate superinterfaces once
  • 2961b7e: 8285364: Remove REF_ enum for java.lang.ref.Reference
  • 167ce4d: 8289421: No-PCH build for Minimal VM was broken by JDK-8287001
  • 108cd69: 8283726: x86_64 intrinsics for compareUnsigned method in Integer and Long

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 29, 2022
@dfuch
Copy link
Member

dfuch commented Jun 29, 2022

Just wondering about using a simple Socket as the client (which is fine). I'd expect it should be possible to see the value of the header with the new HttpClient (unless we filter it?).

@jaikiran
Copy link
Member Author

Just wondering about using a simple Socket as the client (which is fine). I'd expect it should be possible to see the value of the header with the new HttpClient (unless we filter it?).

The Http(s)Server will set the Keep-Alive header only if the incoming request is a HTTP/1.0 version https://github.com/openjdk/jdk/blob/master/src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java#L668. The new HttpClient (and even the old HttpURLConnection) both use a minimum of HTTP 1.1 for requests. So the server won't exercise this piece of code for setting the Keep-Alive header, if we use either the new HttpClient or the HttpURLConnection.

@jaikiran
Copy link
Member Author

Thank you Michael and Daniel for the reviews.

@jaikiran
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Jun 30, 2022

Going to push as commit dddd4e7.
Since your change was applied there have been 11 commits pushed to the master branch:

  • 048bffa: Merge
  • cf71544: 8289252: Recommend Locale.of() method instead of the constructor
  • 5708974: 8288596: Random:from() adapter does not delegate to supplied generator in all cases
  • dbc6e11: 8289399: Update SourceVersion to use snippets
  • 15efb2b: 8289238: Refactoring changes to PassFailJFrame Test Framework
  • b6bd190: 8288985: P11TlsKeyMaterialGenerator should work with ChaCha20-Poly1305
  • ba670ec: 8289094: [JVMCI] reduce JNI overhead and other VM rounds trips in JVMCI
  • 0709a6a: 8284942: Proxy building can just iterate superinterfaces once
  • 2961b7e: 8285364: Remove REF_ enum for java.lang.ref.Reference
  • 167ce4d: 8289421: No-PCH build for Minimal VM was broken by JDK-8287001
  • ... and 1 more: https://git.openjdk.org/jdk/compare/b96ba19807845739b36274efb168dd048db819a3...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jun 30, 2022
@openjdk openjdk bot closed this Jun 30, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jun 30, 2022
@openjdk
Copy link

openjdk bot commented Jun 30, 2022

@jaikiran Pushed as commit dddd4e7.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@jaikiran jaikiran deleted the 8289291 branch June 30, 2022 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated net net-dev@openjdk.org
3 participants