RFR: 8262438: sun/security/ssl/SSLLogger/LoggingFormatConsistency.java failed with "SocketException: Socket is closed"

Evan Whelan ewhelan at openjdk.java.net
Tue Mar 2 15:08:01 UTC 2021

On Fri, 26 Feb 2021 17:17:09 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Hi all,
>> Please review my test fix relating to JDK-8262438
>> This patch introduces as Thread.sleep at the start of each iteration which creates a new test jvm. 
>> This allows the server socket sufficient time to release the previous connection and allows the port to be used again.
>> I also refactored the behaviour for when the exitCode is not 0, allowing for an easier to read output.
>> An incorrect HttpsUrlConnection.disconnect() was also removed.
>> The test was ran 100 times on all platforms and no failures were seen. 
>> Thanks,
>> Evan
> Hi Evan - I am a bit skeptical that the proposed fix will solve the issue. AFAICS the exception is raised by the server side - and if I read it correctly it happens when the server finds that the socket is already closed when it tries to close it. How could sleeping between 2 process invocation solve this? The port used is an ephemeral port - so it should never be the same?
> Does the log show that the same port was being reused?

Hi Daniel, 

>From speaking with you offline, I have ensured that the server-side and client-side socket input streams are emptied.

I have also added some debugging info should this test fail in the future.

I've removed the proposed `Thread.sleep` and the test does not fail in 400 runs



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

More information about the security-dev mailing list