Skip to content

8307648: java/net/httpclient/ExpectContinueTest.java timed out #14207

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

Closed
wants to merge 3 commits into from

Conversation

dfuch
Copy link
Member

@dfuch dfuch commented May 29, 2023

Please find here a fix for the java/net/httpclient/ExpectContinueTest.java which was failing intermittently.

It turns out there was two bugs here:

  • on on the server side, which added the END_STREAM flag to the HeaderFrame containing the 100 response.
    This can obviously never be right since 100 is an intermediary response, which should be followed by a final response.

  • on the client side, because this was interpreted as "there will be no body" - but it didn't prevent the client from waiting for the final response.

With this fix a 100 response carrying the END_STREAM flag will cause the exchange to be cancelled. I manually verified that this worked before fixing the server side.

The logic on server side is fixed to ignore whatever length is passed to sendResponseHeaders() if 100 is supplied, and to not add the END_STREAM flag to the HeaderFrame that carries the 100 response (which is a side effect of setting the expected length parameter to 0 in that case).


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-8307648: java/net/httpclient/ExpectContinueTest.java timed out

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 14207

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented May 29, 2023

👋 Welcome back dfuchs! 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 changed the title 8307648 8307648: java/net/httpclient/ExpectContinueTest.java timed out May 29, 2023
@openjdk openjdk bot added the rfr Pull request is ready for review label May 29, 2023
@openjdk
Copy link

openjdk bot commented May 29, 2023

@dfuch 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 May 29, 2023
@mlbridge
Copy link

mlbridge bot commented May 29, 2023

Webrevs

if (debug.on()) {
debug.log("Received 100 statusCode, but FIN bit is set");
}
cancelImpl(new IOException("stream closed after 100, no other response expected"));
Copy link
Member

Choose a reason for hiding this comment

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

This will produce the wrong error code; see https://datatracker.ietf.org/doc/html/rfc9113#name-http-message-framing :

An interim response consists of a HEADERS frame (which might be followed by zero or more CONTINUATION frames) containing the control data and header section of an interim (1xx) HTTP response (see Section 15 of [HTTP]). A HEADERS frame with the END_STREAM flag set that carries an informational status code is malformed (Section 8.1.1).

Malformed requests or responses that are detected MUST be treated as a stream error (Section 5.4.2) of type PROTOCOL_ERROR.

as far as I could tell, cancelImpl sends CANCEL error code.

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@djelinski djelinski left a comment

Choose a reason for hiding this comment

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

LGTM.
Given that this alters the client behavior, please add a test or a noreg label.

@openjdk
Copy link

openjdk bot commented May 30, 2023

@dfuch 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:

8307648: java/net/httpclient/ExpectContinueTest.java timed out

Reviewed-by: djelinski

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 15 new commits pushed to the master branch:

  • 21af8ba: 8290499: new File(parent, "/") breaks normalization – creates File with slash at the end
  • 804f198: 8308992: New test TestHFA fails with zero
  • fb0b1f0: 8051725: Improve expansion of Conv2B nodes in the middle-end
  • 3eced01: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM
  • 15e0285: 8309110: Build failure after JDK-8307795 due to warnings in micro-benchmark StoreMaskTrueCount.java
  • 4526282: 8308977: gtest:codestrings fails on riscv
  • f600d03: 8307795: AArch64: Optimize VectorMask.truecount() on Neon
  • 07f2070: 8309095: Remove UTF-8 character from TaskbarPositionTest.java
  • 2b186e2: 8309042: MemorySegment::reinterpret cleanup action is not called for all overloads
  • 78aac24: 8308881: Strong CLD oop handle roots are demoted to non-roots concurrently
  • ... and 5 more: https://git.openjdk.org/jdk/compare/d73fc70ea272be6bf4f1c82608c73ff0a8f6032d...master

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 May 30, 2023
@dfuch
Copy link
Member Author

dfuch commented May 30, 2023

I have added 8307648 to the @bug tag in ExpectContinueTest, and also logged https://bugs.openjdk.org/browse/JDK-8309118 to add more deterministic tests for various scenarios.

@dfuch
Copy link
Member Author

dfuch commented May 30, 2023

/integrate

@openjdk
Copy link

openjdk bot commented May 30, 2023

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

  • 6b90b05: 8297878: KEM: Implementation
  • 21af8ba: 8290499: new File(parent, "/") breaks normalization – creates File with slash at the end
  • 804f198: 8308992: New test TestHFA fails with zero
  • fb0b1f0: 8051725: Improve expansion of Conv2B nodes in the middle-end
  • 3eced01: 8304074: [JMX] Add an approximation of total bytes allocated on the Java heap by the JVM
  • 15e0285: 8309110: Build failure after JDK-8307795 due to warnings in micro-benchmark StoreMaskTrueCount.java
  • 4526282: 8308977: gtest:codestrings fails on riscv
  • f600d03: 8307795: AArch64: Optimize VectorMask.truecount() on Neon
  • 07f2070: 8309095: Remove UTF-8 character from TaskbarPositionTest.java
  • 2b186e2: 8309042: MemorySegment::reinterpret cleanup action is not called for all overloads
  • ... and 6 more: https://git.openjdk.org/jdk/compare/d73fc70ea272be6bf4f1c82608c73ff0a8f6032d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 30, 2023

@dfuch Pushed as commit 04b0e78.

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

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
Development

Successfully merging this pull request may close these issues.

2 participants