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

8304962: sun/net/www/http/KeepAliveCache/B5045306.java: java.lang.RuntimeException: Failed: Initial Keep Alive Connection is not being reused #13194

Closed
wants to merge 2 commits into from

Conversation

djelinski
Copy link
Member

@djelinski djelinski commented Mar 27, 2023

This PR fixes intermittent test failures.

The test was broken by 95ca944, which changed the /firstCall handler to return chunked response (second parameter to sendResponseHeaders was 0). The test verifies the behavior of KeepAliveStreamCleaner, which only works on responses containing Content-Length header, and sometimes fails on chunked streams.

Additionally I removed the unnecessary byte-to-character-to-byte conversion introduced in the same commit.
Fixed the test server output. The PrintWriter printed the result of toString() call on a byte array instead of sending the byte array contents.

No failures after 50 test runs. Without the change the test failed 3 times in 10.


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-8304962: sun/net/www/http/KeepAliveCache/B5045306.java: java.lang.RuntimeException: Failed: Initial Keep Alive Connection is not being reused

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 13194

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 27, 2023

👋 Welcome back djelinski! 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 8304962 8304962: sun/net/www/http/KeepAliveCache/B5045306.java: java.lang.RuntimeException: Failed: Initial Keep Alive Connection is not being reused Mar 27, 2023
@openjdk
Copy link

openjdk bot commented Mar 27, 2023

@djelinski 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 Mar 27, 2023
@djelinski djelinski marked this pull request as ready for review March 27, 2023 20:07
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 27, 2023
@mlbridge
Copy link

mlbridge bot commented Mar 27, 2023

Webrevs

pw.print(responseBody);
}
OutputStream os = trans.getResponseBody();
os.write(responseBody);
Copy link
Member

Choose a reason for hiding this comment

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

Hello Daniel, with this change, the OutputStream will no longer be explicitly closed before the exchange trans is closed. But I think that should be OK, because looking at the original code before 95ca944, it too wasn't closing it explicitly, as far as I can see it. So, this looks fine to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added a comment stating that we don't want to close the stream here.

@openjdk
Copy link

openjdk bot commented Mar 28, 2023

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

8304962: sun/net/www/http/KeepAliveCache/B5045306.java: java.lang.RuntimeException: Failed: Initial Keep Alive Connection is not being reused

Reviewed-by: jpai

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

  • 3c4cd50: 8304963: HttpServer closes connection after processing HEAD after JDK-7026262
  • 4f625c0: 8304543: Modernize debugging jvm args in test/hotspot/jtreg/vmTestbase/nsk/jdi/Argument/value/value004.java
  • 426025a: 8303526: Changing "arbitrary" Name.compareTo() ordering breaks the regression suite
  • 6aec6f3: 8304931: vm/concepts/methods/methods001/methods00101m1/methods00101m1 failures with already pending exception
  • 63ce88b: 8304147: JVM crash during shutdown when dumping dynamic archive
  • 554bccf: 8304448: Kitchensink failed: assert(!thread->is_in_any_VTMS_transition()) failed: class prepare events are not allowed in any VTMS transition
  • 3b88b2a: 8304761: Update IANA Language Subtag Registry to Version 2023-03-22
  • f8e8fc7: 8177352: Calendar.getDisplayName(s) in non-lenient mode inconsistent, does not match spec
  • 14b970d: 8296656: java.lang.NoClassDefFoundError exception on running fully legitimate code
  • 80e2d52: 8302558: Editable JComboBox's popup blocks user from seeing characters in Aqua look and feel
  • ... and 12 more: https://git.openjdk.org/jdk/compare/a5ffa079a0d6107be652bc026f5c91b7dcd791f8...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 Mar 28, 2023
@djelinski
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Mar 28, 2023

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

  • a06f461: 8303214: Typo in java.util.Collections#synchronizedNavigableMap javadoc
  • 7987ad4: 8304412: Serial: Refactor old generation cards update after Full GC
  • 3c4cd50: 8304963: HttpServer closes connection after processing HEAD after JDK-7026262
  • 4f625c0: 8304543: Modernize debugging jvm args in test/hotspot/jtreg/vmTestbase/nsk/jdi/Argument/value/value004.java
  • 426025a: 8303526: Changing "arbitrary" Name.compareTo() ordering breaks the regression suite
  • 6aec6f3: 8304931: vm/concepts/methods/methods001/methods00101m1/methods00101m1 failures with already pending exception
  • 63ce88b: 8304147: JVM crash during shutdown when dumping dynamic archive
  • 554bccf: 8304448: Kitchensink failed: assert(!thread->is_in_any_VTMS_transition()) failed: class prepare events are not allowed in any VTMS transition
  • 3b88b2a: 8304761: Update IANA Language Subtag Registry to Version 2023-03-22
  • f8e8fc7: 8177352: Calendar.getDisplayName(s) in non-lenient mode inconsistent, does not match spec
  • ... and 14 more: https://git.openjdk.org/jdk/compare/a5ffa079a0d6107be652bc026f5c91b7dcd791f8...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 28, 2023

@djelinski Pushed as commit cddaf68.

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

@djelinski djelinski deleted the cleaner-test branch March 28, 2023 09:21
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