java/net/httpclient/http2/TLSConnection.java has been observed failing (even 
though rarely) in test jobs.

The issue is that the handler used on the the server sides maintains a volatile 
`sslSession` field which it sets when receiving a request, so that the client 
can check which SSLParameters were negotiated after receiving the response.
However that field is set a little too late: after writing the request body 
bytes. This means that sometimes the client is able to receive the last byte 
before the server has updated the field, and can observe the previous value, 
which was set by the previous request. Checking of SSL parameters on the client 
side then usually fails, as it is looking at the wrong session.

The proposed fix is very simple: just update the `sslSession` field a little 
earlier - before writing the response.

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

Commit messages:
 - 8284892: java/net/httpclient/http2/TLSConnection.java fails intermittently

Changes: https://git.openjdk.java.net/jdk/pull/8249/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8249&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8284892
  Stats: 3 lines in 1 file changed: 2 ins; 1 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8249.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8249/head:pull/8249

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

Reply via email to