-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
8347000: Bug in com/sun/net/httpserver/bugs/B6361557.java test #22921
Conversation
👋 Welcome back jpai! A progress list of the required criteria for merging this PR into |
@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:
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 21 new commits pushed to the
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 |
Having read the RFCs again, I think the JDK's HttpServer implementation isn't violating any expectations set by the RFC. I have responded to the net-dev thread with my reasoning https://mail.openjdk.org/pipermail/net-dev/2025-January/025301.html. |
While the change is reasonable, as it will avoid any ambiguous interpretation of the HTTP GET request used in the test, is not totally correct -- "although the HTTP/1.1 RFC expects an error to be raised", raising of an "error" relates to User Agent behaviour, not the server. The HttpServer used in the test is parsing the GET request correctly and interpreting the Content-Length: 0 correctly, as there is no request body associated with the request, when presented to the HttpHandler. This is can be observed by instrumenting the HttpHandler’s handle method and checking for any request body data. The delimiting of the test’s GET request is Content-Length:0 and the two blank lines. These are the key inputs when parsing a request, hence the additional data written on the HTTP content is not relevant. The stray bytes might cause a problem if a JDK HttpServer were processing a “stream of requests”. But, it would be expected that the server input processing to discard any stray data until to reads a valid request method. Additionally, based on your assumptions, above, an HTTP user agent would not be able to submit consecutive HTTP GET request (with Content-Length: 0 ) on the same TCP connection, to a JDK HttpServer. The change is fine, but I would suggest correcting your assumption in the context of the test. |
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.
Change looks fine.
We probably should have a test of the server that checks it handles pipelined requests correctly (if not optimally). Because a thread is basically assigned to a connection for the duration of a request, it means that pipelined requests will be (or should be in this impl) handled in sequence. Like I said, this isn't optimal, but then again, HTTP/1.1 pipelining has limitations that have been ameliorated by the newer versions of the protocol h2 and h3 (QUIC).
Thank you Mark and Michael for the reviews.
I will look into this and see if there's already any test where we do this. If not, I'll experiment with one as a separate task. |
/integrate |
Going to push as commit 5e6cda4.
Your commit was automatically rebased without conflicts. |
Can I please get a review of this change which proposes to address the test-only issue noted in https://bugs.openjdk.org/browse/JDK-8347000?
As noted in that issue, the test issues HTTP requests with
Content-Length
set to0
implying no request body. However, the code unintentionally sends additional bytes (14 bytes each request) as part of the request. The JDK'sHttpServer
implementation currently doesn't cause errors for such requests (although the HTTP/1.1 RFC expects an error to be raised).The change in this PR merely addresses the test code to not send these additional bytes. The test continues to pass after this change.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22921/head:pull/22921
$ git checkout pull/22921
Update a local copy of the PR:
$ git checkout pull/22921
$ git pull https://git.openjdk.org/jdk.git pull/22921/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 22921
View PR using the GUI difftool:
$ git pr show -t 22921
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22921.diff
Using Webrev
Link to Webrev Comment