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

8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix) #21088

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

varada1110
Copy link
Contributor

@varada1110 varada1110 commented Sep 19, 2024

The preClose() method internally calls the dup2() system call. If there is a dup2() call on a file descriptor on a thread while another thread is blocked in a read/write operation on the same file descriptor, then the dup2() call is known to hang. Currently, preClose() experiences a hang because we call dup2() before killing the reader/writer thread(s). The workaround is to first kill the reader/writer thread(s) and then do the preClose() sequence. This reordering in the different channel implementations resolves the problem.

This is an AIX specific patch by bringing the code change under AIX folder. However, we noticed that the test is not picking up the new code changes. It is going back to old code NioSocketImpl.java#L876.
Therefore, we used System.property and checked for AIX platform pull/21087

We would like to know which is better patch and why the new code change is not recognized by the test.

JBS Issue : JDK-8317801


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-8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix) (Bug - P4)

Contributors

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 21088

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 19, 2024

👋 Welcome back varadam! 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 Sep 19, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Sep 19, 2024

@varada1110 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.

@varada1110
Copy link
Contributor Author

Hi @TheRealMDoerr, could you please review the code. Same workaround as #21087. Here the test doesn't seem to pick up the code changes from the file created under aix. I would like to know which is better patch ?

@varada1110
Copy link
Contributor Author

/contributor add Shruthi.Shruthi1 [email protected]

@openjdk
Copy link

openjdk bot commented Sep 19, 2024

@varada1110
Contributor Shruthi.Shruthi1 <[email protected]> successfully added.

@TheRealMDoerr
Copy link
Contributor

TheRealMDoerr commented Sep 19, 2024

The integration blockers above must get fixed: "Change must not contain extraneous whitespace", "Commit message must refer to an issue"
Please also add a description and explain your solution. (Also what you copied from other files.)

8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix)
Co-authored-by: Shruthi.Shruthi1 <[email protected]>

Signed-off-by: Varada M <[email protected]>
@varada1110 varada1110 changed the title Race.java 8317801: java/net/Socket/asyncClose/Race.java fails intermittently (aix) Sep 19, 2024
@varada1110
Copy link
Contributor Author

I have fixed whitespace errors and commit message. Also I have added explanation in the description

@TheRealMDoerr
Copy link
Contributor

I think that using an extra file only for AIX is not supported by the build. It's not picked up.

Anyway, this PR is a workaround for an AIX problem. We prefer waiting for the AIX fix instead of modifying the JDK.

@@ -0,0 +1,236 @@
/*
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright 2024 IBM Corporation. All rights reserved.

private static final NativeDispatcher nd = new SocketDispatcher();
private final FileDescriptor fd = new FileDescriptor();

// private final FileDescriptor fd;
Copy link
Member

Choose a reason for hiding this comment

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

i see few comments with funny alignment, maybe fix them as well before making it rfr :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants