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

8256459: java/net/httpclient/ManyRequests.java and java/net/httpclient/LineBodyHandlerTest.java fail infrequently with java.net.ConnectException: Connection timed out: no further information #1716

Closed
wants to merge 2 commits into from

Conversation

dfuch
Copy link
Member

@dfuch dfuch commented Dec 9, 2020

Hi,

Please find here a changeset that fixes the infrequent (but annoying) test failures
caused by unexpected ConnectionException "Connection timed out: no further information"
which have been observed to occur on some platforms.

Tests are updated to allow the test server to handle requests concurrently.
PlainHttpConnection is updated to retry connection once if chan::finishConnect fails
early with ConnectionException and the connection timeout has not expired.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8256459: java/net/httpclient/ManyRequests.java and java/net/httpclient/LineBodyHandlerTest.java fail infrequently with java.net.ConnectException: Connection timed out: no further information

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jdk pull/1716/head:pull/1716
$ git checkout pull/1716

…t/LineBodyHandlerTest.java fail infrequently with java.net.ConnectException: Connection timed out: no further information

Tests are updated to allow the test server to handle requests concurrently.
PlainHttpConnection is updated to retry connection once if chan::finishConnect fails
early with ConnectionException and the connection timeout has not expired.
@bridgekeeper
Copy link

bridgekeeper bot commented Dec 9, 2020

👋 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 added the rfr Pull request is ready for review label Dec 9, 2020
@openjdk
Copy link

openjdk bot commented Dec 9, 2020

@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 Dec 9, 2020
@mlbridge
Copy link

mlbridge bot commented Dec 9, 2020

Webrevs

@@ -187,7 +201,43 @@ public void abort(IOException ioe) {
debug.log("Failed to close channel after unsuccessful connect");
}
}
return cf;
return cf.handle((r,t) -> checkRetryConnect(r, t,exchange))
.thenCompose(Function.identity());
Copy link
Member

Choose a reason for hiding this comment

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

So this changes behaviour so that a single subsequent additional TCP connection may be tried for all cases where the connection fails AND there is remaining connection deadline. Ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes - I didn't want to depend on the exception message - and there's no way to distinguish with the exception type (it's raw ConnectionException). It will however happen only when the ConnectionException is thrown by SocketChannel::finishConnect.

Copy link
Member Author

Choose a reason for hiding this comment

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

@ChrisHegarty I have modified the logic to not retry if jdk.httpclient.disableRetryConnect was specified. By default that property is not specified and so we will retry once, but if an application has specifically opted for not retrying on ConnectException then we will not retry.

@openjdk
Copy link

openjdk bot commented Dec 9, 2020

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

8256459: java/net/httpclient/ManyRequests.java and java/net/httpclient/LineBodyHandlerTest.java fail infrequently with java.net.ConnectException: Connection timed out: no further information

Reviewed-by: chegar

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

  • d33a689: 8256867: Classes with empty PermittedSubclasses attribute cannot be extended
  • e6b4c4d: 8238781: [macos] jpackage tests failed due to "hdiutil: convert failed" in various ways
  • b977a7b: 8257989: Error in gtest os_page_size_for_region_unaligned after 8257588
  • 5f03341: 8052260: Reference.isEnqueued() spec does not match the long-standing behavior returning true iff it's in the ref queue
  • 6dd06ad: 8254996: make jdk.net.UnixDomainPrincipal a record class
  • bd22aa5: 8229862: NPE in jdk.compiler/com.sun.tools.javac.jvm.Code.emitop0(Code.java:570)
  • cf62b0a: 8257518: LogCompilation: java.lang.InternalError with JFR turned on
  • 6c69eca: 8257973: UTIL_LOOKUP_PROGS should only find executable files

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 Dec 9, 2020
…t/LineBodyHandlerTest.java fail infrequently with java.net.ConnectException: Connection timed out: no further information

Connect will not be retried if retry connect is disabled
JBS issue label noreg-self removed and bug id added to tests
@dfuch
Copy link
Member Author

dfuch commented Dec 10, 2020

/integrate

@openjdk openjdk bot closed this Dec 10, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 10, 2020
@openjdk
Copy link

openjdk bot commented Dec 10, 2020

@dfuch Since your change was applied there have been 22 commits pushed to the master branch:

  • d93293f: 8256730: Code that uses Object.checkIndex() range checks doesn't optimize well
  • 869dcb6: 8257806: Optimize x86 allTrue and anyTrue vector mask operations of Vector API
  • 34650f5: 8257872: UL: -Xlog does not check number of options
  • 6847bbb: 8255918: XMLStreamFilterImpl constructor consumes XMLStreamException
  • d2f9e31: 8257638: Update usage of "type" terminology in javax.lang.model
  • f631a99: 8256888: Client manual test problem list update
  • eb1c8a1: 8257924: Use full path when running external executable from jpackage
  • 1ce2a36: 8257539: tools/jpackage/windows/WinL10nTest.java unpack.bat failed with Exit code: 1618
  • 53e537c: 8255387: Japanese characters were printed upside down on AIX
  • 0a3e446: 8257993: vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine/TestDescription.java crash intermittently
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/6eff9315e1990f43f896d7416cca4ac87d610840...master

Your commit was automatically rebased without conflicts.

Pushed as commit 4a839e9.

💡 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
2 participants