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

8269481: SctpMultiChannel never releases own file descriptor #4621

Closed
wants to merge 6 commits into from

Conversation

@bplb
Copy link
Member

@bplb bplb commented Jun 29, 2021

Please review this change to the Unix implementations of sun.nio.ch.sctp.Sctp*ChannelImpl#kill() to close the socket if state == ChannelState.UNINITIALIZED.


Progress

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

Issue

  • JDK-8269481: SctpMultiChannel never releases own file descriptor

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4621/head:pull/4621
$ git checkout pull/4621

Update a local copy of the PR:
$ git checkout pull/4621
$ git pull https://git.openjdk.java.net/jdk pull/4621/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4621

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4621.diff

@bplb
Copy link
Member Author

@bplb bplb commented Jun 29, 2021

It would be good if someone more familiar with the SCTP channels could take a look at this one.

Loading

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 29, 2021

👋 Welcome back bpb! 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.

Loading

@openjdk openjdk bot added the rfr label Jun 29, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 29, 2021

@bplb The following labels will be automatically applied to this pull request:

  • net
  • nio

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 29, 2021

Loading

@AlanBateman
Copy link
Contributor

@AlanBateman AlanBateman commented Jun 29, 2021

/label remove nio

Loading

@openjdk openjdk bot removed the nio label Jun 29, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 29, 2021

@AlanBateman
The nio label was successfully removed.

Loading

@bplb
Copy link
Member Author

@bplb bplb commented Jul 1, 2021

If this looks all right could I get an approval please?

Loading

Copy link
Contributor

@AlanBateman AlanBateman left a comment

The implementation changes in the latest round look fine.

I didn't study the test too closely I wonder about the reliability of using a hard coded port (12345) and using losf on an agent VM. I think it will minimally need to run in /othervm mode to avoid shimmer in the numbest of open file descriptors that might arise due to the tests that ran previously in the same VM.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jul 2, 2021

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

8269481: SctpMultiChannel never releases own file descriptor

Reviewed-by: alanb, 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 226 new commits pushed to the master branch:

  • 77a5b7b: 8269761: idea.sh missing .exe suffix when invoking javac on WSL
  • 248aa50: 8269294: Verify_before/after_young_collection should execute all verification
  • 18b80c7: 8269908: Move MemoryService::track_memory_usage call into G1MonitoringScope
  • a685011: 8269022: Put evacuation failure string directly into gc=info log message
  • 72530ef: 8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw() for JVMTI exception events
  • 3d090e7: 8267625: AARCH64: typo in LIR_Assembler::emit_profile_type
  • a9e2010: 8268425: Show decimal nid of OSThread instead of hex format one
  • 01c29d8: 8266407: remove jdk.internal.javac.PreviewFeature.Feature.SEALED_CLASSES
  • 7a4f08a: Merge
  • 0d1cd3a: 8269825: [TESTBUG] Missing testing for x86 KNL platforms
  • ... and 216 more: https://git.openjdk.java.net/jdk/compare/cd20c01942dd8559a31e51ef2a595c6eba44b8ad...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.

Loading

@openjdk openjdk bot added the ready label Jul 2, 2021
Copy link
Contributor

@AlanBateman AlanBateman left a comment

Thanks for the update. You should probably wait for Chris as he had comments on this too.

Loading

@bplb
Copy link
Member Author

@bplb bplb commented Jul 2, 2021

Sure, no problem.

Loading

int nfds = lines.length - 1;
if (nfds > 3) {
String msg =
String.format("Number of open descriptors (%d) > 2%n", nfds);
Copy link
Member

@jaikiran jaikiran Jul 4, 2021

Choose a reason for hiding this comment

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

Hello Brian,

The if condition checks for > 3 whereas the error message states > 2. Should the error message be changed? Also, I see that there's a MAX_DESC constant in this test, but from what I can see isn't used anywhere? Perhaps that's the constant you wanted to use in this if block and the error message?

Loading

@bplb
Copy link
Member Author

@bplb bplb commented Jul 7, 2021

/integrate

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Jul 7, 2021

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

  • 2209e3e: 8270027: ProblemList jdk/jfr/event/oldobject/TestObjectSize.java on macOS-x64
  • 2dc5486: 8267303: Replace MinObjectAlignmentSize usages for non-Java heap objects
  • 3586a23: 8268635: Corrupt oop in ClassLoaderData
  • bffb1a7: 8269923: runtime/jni/checked/TestPrimitiveArrayCriticalWithBadParam.java failed with "FATAL ERROR in native method: Primitive type array expected but not received for JNI array operation"
  • 77a5b7b: 8269761: idea.sh missing .exe suffix when invoking javac on WSL
  • 248aa50: 8269294: Verify_before/after_young_collection should execute all verification
  • 18b80c7: 8269908: Move MemoryService::track_memory_usage call into G1MonitoringScope
  • a685011: 8269022: Put evacuation failure string directly into gc=info log message
  • 72530ef: 8269574: C2: Avoid redundant uncommon traps in GraphKit::builtin_throw() for JVMTI exception events
  • 3d090e7: 8267625: AARCH64: typo in LIR_Assembler::emit_profile_type
  • ... and 220 more: https://git.openjdk.java.net/jdk/compare/cd20c01942dd8559a31e51ef2a595c6eba44b8ad...master

Your commit was automatically rebased without conflicts.

Loading

@openjdk openjdk bot closed this Jul 7, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Jul 7, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jul 7, 2021

@bplb Pushed as commit d1cecaa.

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

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Brian Burkhalter on net-dev:

On Jul 1, 2021, at 1:17 AM, Alan Bateman <alanb at openjdk.java.net<mailto:alanb at openjdk.java.net>> wrote:

It looks like you've changed some but not all cases. I realize ChannelState.UNINITIALIZED is not too interesting but further maintainers may wonder about it.

I?m not seeing that I missed any cases. I don?t really want to get into modifying the states in this PR.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/8e7697f9/attachment.htm>

Loading

2 similar comments
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Brian Burkhalter on net-dev:

On Jul 1, 2021, at 1:17 AM, Alan Bateman <alanb at openjdk.java.net<mailto:alanb at openjdk.java.net>> wrote:

It looks like you've changed some but not all cases. I realize ChannelState.UNINITIALIZED is not too interesting but further maintainers may wonder about it.

I?m not seeing that I missed any cases. I don?t really want to get into modifying the states in this PR.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/8e7697f9/attachment.htm>

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Brian Burkhalter on net-dev:

On Jul 1, 2021, at 1:17 AM, Alan Bateman <alanb at openjdk.java.net<mailto:alanb at openjdk.java.net>> wrote:

It looks like you've changed some but not all cases. I realize ChannelState.UNINITIALIZED is not too interesting but further maintainers may wonder about it.

I?m not seeing that I missed any cases. I don?t really want to get into modifying the states in this PR.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/8e7697f9/attachment.htm>

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Alan Bateman on net-dev:

On 01/07/2021 16:47, Brian Burkhalter wrote:

On Jul 1, 2021, at 1:17 AM, Alan Bateman <alanb at openjdk.java.net
<mailto:alanb at openjdk.java.net>> wrote:

It looks like you've changed some but not all cases. I realize
ChannelState.UNINITIALIZED is not too interesting but further
maintainers may wonder about it.

I?m not seeing that I missed any cases. I don?t really want to get
into modifying the states in this PR.

I should have been clearer. Look at SctpServerChannelImpl.java L284 and
SctpMultiChannelImpl.java L376.? SctpNet.close(fdVal) added with the
patch added them them before setting the state. The suggestion in the
previous comments was to insert the close after setting the state to
KILLED in case the close fail (in some corner case).

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/722020e6/attachment.htm>

Loading

2 similar comments
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Alan Bateman on net-dev:

On 01/07/2021 16:47, Brian Burkhalter wrote:

On Jul 1, 2021, at 1:17 AM, Alan Bateman <alanb at openjdk.java.net
<mailto:alanb at openjdk.java.net>> wrote:

It looks like you've changed some but not all cases. I realize
ChannelState.UNINITIALIZED is not too interesting but further
maintainers may wonder about it.

I?m not seeing that I missed any cases. I don?t really want to get
into modifying the states in this PR.

I should have been clearer. Look at SctpServerChannelImpl.java L284 and
SctpMultiChannelImpl.java L376.? SctpNet.close(fdVal) added with the
patch added them them before setting the state. The suggestion in the
previous comments was to insert the close after setting the state to
KILLED in case the close fail (in some corner case).

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/722020e6/attachment.htm>

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Alan Bateman on net-dev:

On 01/07/2021 16:47, Brian Burkhalter wrote:

On Jul 1, 2021, at 1:17 AM, Alan Bateman <alanb at openjdk.java.net
<mailto:alanb at openjdk.java.net>> wrote:

It looks like you've changed some but not all cases. I realize
ChannelState.UNINITIALIZED is not too interesting but further
maintainers may wonder about it.

I?m not seeing that I missed any cases. I don?t really want to get
into modifying the states in this PR.

I should have been clearer. Look at SctpServerChannelImpl.java L284 and
SctpMultiChannelImpl.java L376.? SctpNet.close(fdVal) added with the
patch added them them before setting the state. The suggestion in the
previous comments was to insert the close after setting the state to
KILLED in case the close fail (in some corner case).

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/722020e6/attachment.htm>

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Brian Burkhalter on net-dev:

Oh I see now. Thanks.

On Jul 1, 2021, at 8:56 AM, Alan Bateman <alan.bateman at oracle.com<mailto:alan.bateman at oracle.com>> wrote:

I should have been clearer. Look at SctpServerChannelImpl.java L284 and SctpMultiChannelImpl.java L376. SctpNet.close(fdVal) added with the patch added them them before setting the state. The suggestion in the previous comments was to insert the close after setting the state to KILLED in case the close fail (in some corner case).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/e709c9b8/attachment-0001.htm>

Loading

2 similar comments
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Brian Burkhalter on net-dev:

Oh I see now. Thanks.

On Jul 1, 2021, at 8:56 AM, Alan Bateman <alan.bateman at oracle.com<mailto:alan.bateman at oracle.com>> wrote:

I should have been clearer. Look at SctpServerChannelImpl.java L284 and SctpMultiChannelImpl.java L376. SctpNet.close(fdVal) added with the patch added them them before setting the state. The suggestion in the previous comments was to insert the close after setting the state to KILLED in case the close fail (in some corner case).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/e709c9b8/attachment-0001.htm>

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jul 8, 2021

Mailing list message from Brian Burkhalter on net-dev:

Oh I see now. Thanks.

On Jul 1, 2021, at 8:56 AM, Alan Bateman <alan.bateman at oracle.com<mailto:alan.bateman at oracle.com>> wrote:

I should have been clearer. Look at SctpServerChannelImpl.java L284 and SctpMultiChannelImpl.java L376. SctpNet.close(fdVal) added with the patch added them them before setting the state. The suggestion in the previous comments was to insert the close after setting the state to KILLED in case the close fail (in some corner case).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210701/e709c9b8/attachment-0001.htm>

Loading

@bplb bplb deleted the SctpMultiChannel-close-8269481 branch Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants