RFR: 8164804: sun/security/ssl/SSLSocketImpl/CloseSocket.java makes not reliable time assumption [v2]

Rajan Halade rhalade at openjdk.java.net
Mon May 10 15:44:18 UTC 2021


On Wed, 5 May 2021 11:13:13 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Thanks, updated to be volatile.
>> 
>> SSLSocket::startHandshake internally first checks that the socket is not closed or broken and still connected, so it needs the server to close the socket after those verifications are performed to reproduce the test scenario, thus a CountDownLatch in the test before calling startHandshake would not guarantee that its internal operations are run before the server, already unblocked at that time, closes the socket
>> 
>> A CountDownLatch after startHandshake does not work either since the client keeps waiting for a server response, which is blocked waiting for the latch. That is why I think that looking at the thread stack is the best way to guarantee the scenario is properly verified
>
> OK

Can you please add this as a comment in a test file for clientThread variable? I am sure we will have (failed) try to convert it to CountDownLatch in future.

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

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



More information about the security-dev mailing list