Hi, Please find below a fix for:
8216562: UnknownBodyLength sometimes fails due to "Connection reset by peer" https://bugs.openjdk.java.net/browse/JDK-8216562 webrev: http://cr.openjdk.java.net/~dfuchs/webrev_8216562/webrev.00/ My previous attempt at at fixing this test proved unsuccessful, as I was still seeing some very infrequent failures - caused by connection reset, with https. The present fix does 3 things: 1. increase the SO_LINGER time, to reduce the risk of generating a reset (1s -> 30s). 2. keep the accepted socket around (server side) until the client finishes - to avoid it to be prematurely gc'ed and its file descriptor released. 3. calls shutdownOutput() - but delay closing the socket until the client finishes. This should also reduce the risk of generating a reset. with this, I haven't been able to reproduce the issue yet. I believe it does fix it - though I'm afraid only time will tell... best regards, -- daniel