-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8274524: SSLSocket.close() hangs if it is called during the ssl handshake #5760
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
Conversation
|
👋 Welcome back abakhtin! A progress list of the required criteria for merging this PR into |
|
@alexeybakhtin The following label will be automatically applied to this pull request:
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. |
Webrevs
|
|
Hi @alexeybakhtin, Thank you for the PR. I have a question regarding the lock, Would adding a |
Hi Clive, |
|
Thank you @alexeybakhtin, The change looks good to me, but I am not a reviewer. |
|
@alexeybakhtin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
New jtreg test is added to reproduce the issue and verify it. |
|
Gentle ping. |
|
Did you have a chance to analysis the potential deadlock issues between handshake lock, read lock, write lock and socket lock? The locks used in SSLSocketImpl is complicated. If I remember correctly, there are potential deadlock issues if the read/write locks are used during handshaking. Did you have a dead lock stack for the bug? Alternatively, it might be a direction to improve the close() code. |
Hi @XueleiFan, Thank you for review. |
|
@alexeybakhtin This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration! |
|
@alexeybakhtin This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the |
|
With the patch, the readLock is placed in handshakeLock, and the handshake may require lock write lock. These nested lock is pretty risk and will run into deadlocks. That's the underlying reason why readHandshakeRecord() is not placed within read lock and write lock. It looks like the problem is cause by close() method. Maybe, improving the close() implementation could be an alternative solution. For example, give up the skip operation if no lock can be granted. |
|
Hi @XueleiFan thank you for explanation and suggestions. |
Please review the patch for JDK-8274524
The fix just adds locks around InputStream read and skip operations to prevent concurrent read from socket.
sun/security/ssl jtreg tests passed
api/javax_net/ssl/SSLSocket/setUseClientMode jck test passed
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5760/head:pull/5760$ git checkout pull/5760Update a local copy of the PR:
$ git checkout pull/5760$ git pull https://git.openjdk.java.net/jdk pull/5760/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 5760View PR using the GUI difftool:
$ git pr show -t 5760Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5760.diff