On Wed, 3 Nov 2021 17:02:40 GMT, Alexey Bakhtin <abakh...@openjdk.org> 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
>> api/javax_net/ssl/SSLSocket/setUseClientMode jck test passed
>
> 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 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.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5760

Reply via email to