RFR [13] JDK-8224829 : AsyncSSLSocketClose.java has timing issue

Xuelei Fan xuelei.fan at oracle.com
Tue Jun 4 18:10:54 UTC 2019


Hi,

Could I get the following update reviewed?
    http://cr.openjdk.java.net/~xuelei/8224829/webrev.00/

If using one thread for closing, one thread for writing.  Closing and 
writing threads are synchronized in order to delivery close_notify TLS 
record.  There are could be race between the two threads.  If the output 
stream buffer reach the limit, the write will be blocked, and then the 
close thread may be pending.

The SO_LINGER is used to resolve the issue for general socket.  With the 
above update, the SSLSocket implementation will check the SO_LINGER as 
well.  If SO_LINGER is on, the SSLSocket close will try to get the 
synchronization lock in the time of SO_LINGER value.  If timeout, the 
close process will move on, and close the underlying socket by force.

Thanks,
Xuelei



More information about the security-dev mailing list