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

8299813: java/nio/channels/DatagramChannel/Disconnect.java fails with jtreg test timeout due to lost datagram #19908

Closed
wants to merge 4 commits into from

Conversation

dfuch
Copy link
Member

@dfuch dfuch commented Jun 26, 2024

Please find here a simple fix to solve an intermittent failure in java/nio/channels/DatagramChannel/Disconnect.java

On some platform, the underlying system may allow two datagram sockets to bind to the same port, if one of them uses the wildcard address and the other doesn't.

What happens here is that during DC:connect, if the socket is unbound, it will get bound to the wildcard.
From time to time, this results into binding to the same port that the server is using in the test.
When that happens, datagram sent to the connected server may get misrouted and may not get delivered, and the call server::receive may block forever.

This change does two things:

  1. explicitly bind the server to the loopback address instead of InetAddress.getLocalHost()
  2. skip the receive part of the test if the client local address obtained after connecting uses the same port than the server.

This is rare, and skipping the receive part in that case does not invalidate the test.


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-8299813: java/nio/channels/DatagramChannel/Disconnect.java fails with jtreg test timeout due to lost datagram (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19908

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 26, 2024

👋 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
Copy link

openjdk bot commented Jun 26, 2024

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

8299813: java/nio/channels/DatagramChannel/Disconnect.java fails with jtreg test timeout due to lost datagram

Reviewed-by: aefimov

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

  • c798316: 8269657: Test java/nio/channels/DatagramChannel/Loopback.java failed: Unexpected message
  • 99d2bbf: 8334433: jshell.exe runs an executable test.exe on startup
  • 6f4ddc2: 8335142: compiler/c1/TestTraceLinearScanLevel.java occasionally times out with -Xcomp
  • 3b3a19e: 8335314: Problem list compiler/uncommontrap/DeoptReallocFailure.java
  • d457609: 8319947: Recursive lightweight locking: s390x implementation
  • c47a0e0: 8334147: Shenandoah: Avoid taking lock for disabled free set logging
  • 308a812: 8334645: Un-problemlist vmTestbase/nsk/sysdict/vm/stress/chain/chain007/chain007.java
  • b4df380: 8334763: --enable-asan: assert(_thread->is_in_live_stack((address)this)) failed: not on stack?
  • cd46c87: 8334843: RISC-V: Fix wraparound checking for r_array_index in lookup_secondary_supers_table_slow_path
  • 4e8cbf8: 8335134: Test com/sun/jdi/BreakpointOnClassPrepare.java timeout
  • ... and 59 more: https://git.openjdk.org/jdk/compare/55c796946158aab1d019a57b77a33441d7b13065...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 rfr Pull request is ready for review label Jun 26, 2024
@openjdk
Copy link

openjdk bot commented Jun 26, 2024

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

  • nio

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 nio nio-dev@openjdk.org label Jun 26, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 26, 2024

Webrevs

Copy link
Member

@AlekseiEfimov AlekseiEfimov left a comment

Choose a reason for hiding this comment

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

The changes look good to me.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 28, 2024
@dfuch
Copy link
Member Author

dfuch commented Jun 28, 2024

Thanks @AlekseiEfimov ! If I don't receive further feedback I will integrate shortly

@dfuch
Copy link
Member Author

dfuch commented Jun 28, 2024

/integrate

@openjdk
Copy link

openjdk bot commented Jun 28, 2024

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

  • 8ec378a: 8277949: (dc) java/nio/channels/DatagramChannel/AdaptorBasic.java failed in timeout
  • c798316: 8269657: Test java/nio/channels/DatagramChannel/Loopback.java failed: Unexpected message
  • 99d2bbf: 8334433: jshell.exe runs an executable test.exe on startup
  • 6f4ddc2: 8335142: compiler/c1/TestTraceLinearScanLevel.java occasionally times out with -Xcomp
  • 3b3a19e: 8335314: Problem list compiler/uncommontrap/DeoptReallocFailure.java
  • d457609: 8319947: Recursive lightweight locking: s390x implementation
  • c47a0e0: 8334147: Shenandoah: Avoid taking lock for disabled free set logging
  • 308a812: 8334645: Un-problemlist vmTestbase/nsk/sysdict/vm/stress/chain/chain007/chain007.java
  • b4df380: 8334763: --enable-asan: assert(_thread->is_in_live_stack((address)this)) failed: not on stack?
  • cd46c87: 8334843: RISC-V: Fix wraparound checking for r_array_index in lookup_secondary_supers_table_slow_path
  • ... and 60 more: https://git.openjdk.org/jdk/compare/55c796946158aab1d019a57b77a33441d7b13065...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 28, 2024

@dfuch Pushed as commit 49eb00d.

💡 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 nio nio-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

2 participants