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

8267938: (sctp) SCTP channel factory methods should check platform support #4246

Closed
wants to merge 1 commit into from

Conversation

ChrisHegarty
Copy link
Member

@ChrisHegarty ChrisHegarty commented May 28, 2021

The SCTP channel factory methods, namely SctpChannel::open, SctpServerChannel::open, and SctpMultiChannel::open, are specified to throw UnsupportedOperationException, if the SCTP protocol is not supported. Currently, underlying platform support is assumed once the appropriate libsctp.so.1 library is present (along with its supported interface functions). This may not always be the case, e.g. if the Linux sctp kernel module is not present or loaded. In which case a SocketException is thrown.

It would be more appropriate to check for EPROTONOSUPPORT and ESOCKTNOSUPPORT, and throw UOE rather than SE.

The existing java/net/SctpSanity.java tests already covers this case, when run on platforms without support.


Progress

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

Issue

  • JDK-8267938: (sctp) SCTP channel factory methods should check platform support

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4246

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented May 28, 2021

👋 Welcome back chegar! 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 label May 28, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 28, 2021

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

  • net
  • security

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.

@openjdk openjdk bot added security net labels May 28, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented May 28, 2021

Webrevs

@ChrisHegarty ChrisHegarty changed the title 8267938: SCTP channel factory methods should check platform support 8267938: (sctp) SCTP channel factory methods should check platform support May 28, 2021
@ChrisHegarty
Copy link
Member Author

@ChrisHegarty ChrisHegarty commented May 28, 2021

/label remove security

@openjdk openjdk bot removed the security label May 28, 2021
@openjdk
Copy link

@openjdk openjdk bot commented May 28, 2021

@ChrisHegarty
The security label was successfully removed.

dfuch
dfuch approved these changes May 28, 2021
Copy link
Member

@dfuch dfuch left a comment

LGTM

@openjdk
Copy link

@openjdk openjdk bot commented May 28, 2021

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

8267938: (sctp) SCTP channel factory methods should check platform support

Reviewed-by: dfuchs, jiefu, alanb, vtewari

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:

  • 591b0c3: 8264624: change the guarantee() calls added by JDK-8264123 to assert() calls
  • 0c0ff7f: 8265309: com/sun/jndi/dns/ConfigTests/Timeout.java fails with "Address already in use" BindException
  • 24bf35f: 8265367: [macos-aarch64] 3 java/net/httpclient/websocket tests fail with "IOException: No buffer space available"
  • 1413f9e: 8241423: NUMA APIs fail to work in dockers due to dependent syscalls are disabled by default
  • 1d2c7ac: 8267555: Fix class file version during redefinition after 8238048
  • 97ec5ad: 8265753: Remove manual JavaThread transitions to blocked
  • 6eb9114: 8266877: Missing local debug information when debugging JEP-330
  • 0c9daa7: 8265029: Preserve SIZED characteristics on slice operations (skip, limit)
  • 95b1fa7: 8267529: StringJoiner can create a String that breaks String::equals
  • 7f52c50: 8182043: Access to Windows Large Icons
  • ... and 12 more: https://git.openjdk.java.net/jdk/compare/7278f56bb6345d7b023516d0f44de71cd74ff264...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 label May 28, 2021
Copy link
Member

@DamonFool DamonFool left a comment

java/net/SctpSanity.java passed on our machine with this patch.
Thanks for fixing it.

@AlanBateman
Copy link
Contributor

@AlanBateman AlanBateman commented May 28, 2021

EPROTONOSUPPORT and ESOCKTNOSUPPORT are subtly different and I don't know if ESOCKTNOSUPPORT is possible. Checking both errors is okay/harmless so I think this change is okay.

@ChrisHegarty
Copy link
Member Author

@ChrisHegarty ChrisHegarty commented May 28, 2021

EPROTONOSUPPORT and ESOCKTNOSUPPORT are subtly different and I don't know if ESOCKTNOSUPPORT is possible. Checking both errors is okay/harmless so I think this change is okay.

ESOCKTNOSUPPORT is the reported error for SOCK_SEQPACKET (SctpMultiChannel), when the kernel SCTP module is not present.

Copy link
Contributor

@vyommani vyommani left a comment

Looks OK to me.

@ChrisHegarty
Copy link
Member Author

@ChrisHegarty ChrisHegarty commented May 31, 2021

/integrate

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

@openjdk openjdk bot commented May 31, 2021

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

  • 7ab6b40: 8267375: Aarch64: JVM crashes with option -XX:PrintIdealGraphLevel=3 on SVE backend
  • 2c8e94f: 8247403: JShell: No custom input (e.g. from GUI) possible with JavaShellToolBuilder
  • 64f0f68: 8267464: Circular-dependency resilient inline headers
  • ab5a7ff: 8267587: Update java.util to use enhanced switch
  • 35916ed: 8267806: C1: Relax inlining checks for not yet initialized classes
  • 1e29005: 8267842: SIGSEGV in get_current_contended_monitor
  • 236bd89: 8263583: Emoji rendering on macOS
  • 1ab2776: 8247608: Javadoc: CSS margin is not applied consistently
  • 9031477: 8267945: ZGC: Revert NUMA changes (JDK-8266217 and JDK-8241354) after JDK-8241423
  • 6627432: 8267953: restore 'volatile' to ObjectMonitor::_owner field
  • ... and 23 more: https://git.openjdk.java.net/jdk/compare/7278f56bb6345d7b023516d0f44de71cd74ff264...master

Your commit was automatically rebased without conflicts.

Pushed as commit bd31653.

💡 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 net
5 participants