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

JDK-8315422: getSoTimeout() would be in try block in SSLSocketImpl #15503

Closed
wants to merge 1 commit into from

Conversation

johnshajiang
Copy link
Member

@johnshajiang johnshajiang commented Aug 31, 2023

The method SSLSocketImpl::closeSocket has the below code snippet,

if (appInput.readLock.tryLock()) {
    int soTimeout = getSoTimeout();
    try {
        // deplete could hang on the skip operation
        // in case of infinite socket read timeout.
        // Change read timeout to avoid deadlock.
        // This workaround could be replaced later
        // with the right synchronization
        if (soTimeout == 0)
            setSoTimeout(DEFAULT_SKIP_TIMEOUT);
        inputRecord.deplete(false);
    } catch (java.net.SocketTimeoutException stEx) {
        // skip timeout exception during deplete
    } finally {
        if (soTimeout == 0)
            setSoTimeout(soTimeout);
        appInput.readLock.unlock();
    }
}

If getSoTimeout() throws an exception, say SocketException, appInput.readLock.unlock() cannot be called.


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-8315422: getSoTimeout() would be in try block in SSLSocketImpl (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15503

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 31, 2023

👋 Welcome back jjiang! 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 Aug 31, 2023
@openjdk
Copy link

openjdk bot commented Aug 31, 2023

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

  • security

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 security security-dev@openjdk.org label Aug 31, 2023
@mlbridge
Copy link

mlbridge bot commented Aug 31, 2023

Webrevs

Copy link
Member

@jnimeh jnimeh left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@openjdk
Copy link

openjdk bot commented Aug 31, 2023

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

8315422: getSoTimeout() would be in try block in SSLSocketImpl

Reviewed-by: jnimeh

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 1 new commit pushed to the master branch:

  • 218829e: 8315421: [BACKOUT] 8314834 serviceability/jdwp/AllModulesCommandTest.java ignores VM flags

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 Aug 31, 2023
@johnshajiang
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Aug 31, 2023

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

  • d5973bd: 6333341: [BI] Doc: java.text.BreakIterator class specification is unclear
  • 63f561f: 8306882: (fs) Path.toRealPath(LinkOption.NOFOLLOW_LINKS) fails when "../../" follows a link
  • 2436fb0: 8312306: Add more Reference.reachabilityFence() calls to the security classes using Cleaner
  • 351c31e: 8315378: [BACKOUT] runtime/NMT/SummarySanityCheck.java failed with "Total committed (MMMMMM) did not match the summarized committed (NNNNNN)"
  • c12ca88: 8312521: Unused field LocaleProviderAdapter#defaultLocaleProviderAdapter could be removed
  • b38bcae: 8313656: assert(!JvmtiExport::can_support_virtual_threads()) with -XX:-DoJVMTIVirtualThreadTransitions
  • c8acab1: 8315413: Remove special filtering of Continuation.yield0 in StackWalker
  • ea5aa61: 8315383: jlink SystemModulesPlugin incorrectly parses the options
  • 29ff1e4: 8315445: 8314748 causes crashes in x64 builds
  • 145d8bc: 8315051: jdk/jfr/jvm/TestGetEventWriter.java fails with non-JVMCI GCs
  • ... and 6 more: https://git.openjdk.org/jdk/compare/3c8a6678feac8e3225bc1c44593a78d9e7c4d77c...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Aug 31, 2023

@johnshajiang Pushed as commit 2264667.

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

@johnshajiang johnshajiang deleted the 8315422 branch August 31, 2023 22:27
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 security security-dev@openjdk.org
2 participants