Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v2]

2022-02-11 Thread Xue-Lei Andrew Fan
On Fri, 11 Feb 2022 20:07:43 GMT, Alexey Bakhtin wrote: >> Please review the patch for the JDK-8274524 >> >> SSLSocket.close() could cause an intermittent hang of the socket read >> operation. It happens in case of SO_TIMEOUT is set to 0 (infinite timeout). >> SSLSocket.close() reads from the

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v2]

2022-02-11 Thread Alexey Bakhtin
> Please review the patch for the JDK-8274524 > > SSLSocket.close() could cause an intermittent hang of the socket read > operation. It happens in case of SO_TIMEOUT is set to 0 (infinite timeout). > SSLSocket.close() reads from the socket as part of the skip() operation to > prevent TCP

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2022-02-11 Thread Alexey Bakhtin
On Fri, 11 Feb 2022 18:04:35 GMT, Xue-Lei Andrew Fan wrote: >> Hi @XueleiFan, >> Not quite sure What could be wrong with setting SO_TIMEOUT during the >> socketClose() operation. We still close the socket and SO_TIMEOUT will be >> restored just after skip() operation is completed. These

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2022-02-11 Thread Xue-Lei Andrew Fan
On Fri, 11 Feb 2022 09:27:11 GMT, Alexey Bakhtin wrote: >> src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java line 1792: >> >>> 1790: try { >>> 1791: if (soTimeout == 0) >>> 1792:

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2022-02-11 Thread Alexey Bakhtin
On Thu, 10 Feb 2022 23:59:40 GMT, Xue-Lei Andrew Fan wrote: >> Please review the patch for the JDK-8274524 >> >> SSLSocket.close() could cause an intermittent hang of the socket read >> operation. It happens in case of SO_TIMEOUT is set to 0 (infinite timeout). >> SSLSocket.close() reads from

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2022-02-10 Thread Xue-Lei Andrew Fan
On Thu, 10 Feb 2022 18:19:41 GMT, Alexey Bakhtin wrote: > Please review the patch for the JDK-8274524 > > SSLSocket.close() could cause an intermittent hang of the socket read > operation. It happens in case of SO_TIMEOUT is set to 0 (infinite timeout). > SSLSocket.close() reads from the

RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2022-02-10 Thread Alexey Bakhtin
Please review the patch for the JDK-8274524 SSLSocket.close() could cause an intermittent hang of the socket read operation. It happens in case of SO_TIMEOUT is set to 0 (infinite timeout). SSLSocket.close() reads from the socket as part of the skip() operation to prevent TCP Connection reset

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v4]

2022-02-10 Thread Alexey Bakhtin
On Wed, 9 Feb 2022 22:09:40 GMT, Xue-Lei Andrew Fan wrote: >> Alexey Bakhtin has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix jcheck issues > > With the patch, the readLock is placed in handshakeLock, and the handshake > may require

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v4]

2022-02-09 Thread Xue-Lei Andrew Fan
On Wed, 3 Nov 2021 17:02:40 GMT, Alexey Bakhtin wrote: >> 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 >>

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v4]

2021-11-10 Thread Alexey Bakhtin
On Wed, 10 Nov 2021 17:28:18 GMT, Xue-Lei Andrew Fan wrote: > 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 >

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v4]

2021-11-10 Thread Xue-Lei Andrew Fan
On Wed, 3 Nov 2021 17:02:40 GMT, Alexey Bakhtin wrote: >> 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 >>

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v4]

2021-11-10 Thread Alexey Bakhtin
On Wed, 3 Nov 2021 17:02:40 GMT, Alexey Bakhtin wrote: >> 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 >>

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v3]

2021-11-03 Thread Alexey Bakhtin
> 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 Alexey Bakhtin has updated the pull

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v4]

2021-11-03 Thread Alexey Bakhtin
> 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 Alexey Bakhtin has updated the pull

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v3]

2021-11-03 Thread Alexey Bakhtin
On Wed, 3 Nov 2021 16:46:49 GMT, Alexey Bakhtin wrote: >> 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 >>

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2021-10-01 Thread Clive Verghese
On Fri, 1 Oct 2021 10:49:00 GMT, Alexey Bakhtin wrote: >> Hi @alexeybakhtin, >> >> Thank you for the PR. >> >> I have a question regarding the lock, Would adding a >> `appInput.readLock.lock()` in `SSLSocketImpl:decode(ByteBuffer)` resolve >> this issue? > >> Hi @alexeybakhtin, >> >>

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2021-10-01 Thread Alexey Bakhtin
On Thu, 30 Sep 2021 23:04:20 GMT, Clive Verghese wrote: > Hi @alexeybakhtin, > > Thank you for the PR. > > I have a question regarding the lock, Would adding a > `appInput.readLock.lock()` in `SSLSocketImpl:decode(ByteBuffer)` resolve this > issue? Hi Clive, Thank you for your review. I

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake [v2]

2021-10-01 Thread Alexey Bakhtin
> 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 Alexey Bakhtin has updated the pull

Re: RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2021-09-30 Thread Clive Verghese
On Wed, 29 Sep 2021 19:31:53 GMT, Alexey Bakhtin wrote: > 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 >

RFR: 8274524: SSLSocket.close() hangs if it is called during the ssl handshake

2021-09-29 Thread Alexey Bakhtin
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 - Commit messages: - 8274524: