[jdk17u-dev] RFR: 8343855: HTTP/2 ConnectionWindowUpdateSender may miss some unprocessed DataFrames from closed streams
Goetz Lindenmaier
goetz at openjdk.org
Thu Aug 14 12:45:58 UTC 2025
I backport this for parity with 17.0.17-oracle.
Also, it is a follow-up to JDK-8342075.
It needed resolves and adaptions:
**Resolved** the first chunk in Stream.java which adds the declaration of inputQLock.
The declaraions in the context have been modified by "8308310: HttpClient: Avoid logging or locking from within synchronized blocks".
Omitted one chunk fixing white space.
See first commit.
**Adaptions** can be found in the second commit.
The change uses locks from 8308310 and introduces a new lock.
To make this work further adaptions are needed (see extra commit):
I add edimports required by the new lock inputQLock.
stateLock is used by this change, but only introduced by 8308310.
Where 21 uses stateLock, the implementation in 17 locks
itself ("this"). I changed the use of stateLock introduced
by this change in pushDateaFrame() accordingly.
Actually, 17 declares a row of methods as synchronized
that are not handled by stateLock in 21, e.g. isCanceled().
So there is a difference in behavior wrt. this lock
between 17 and 21.
I needed to fix two build issues in StreamFlowControlTest.java:
.../test/jdk/java/net/httpclient/http2/StreamFlowControlTest.java:299: error: incompatible types: try-with-resources not applicable to variable type
try (var client = HttpClient.newBuilder().sslContext(sslContext).build()) {
^
(HttpClient cannot be converted to AutoCloseable)
/.../test/jdk/java/net/httpclient/http2/StreamFlowControlTest.java:300: error: cannot find symbol
var request = HttpRequest.newBuilder(URI.create(h2Head)).HEAD().build();
^
symbol: method HEAD()
location: interface Builder
The first I resolved similar to other places in this test in the backport that
brought the test to 17: https://github.com/openjdk/jdk17u-dev/pull/3786/commits/073bb3d5b0391cf9ad419a9b2be0d30afba1427b
Thanks to Aleksey for this detail.
For the second issue I replaced HEAD() by it's implementation.
-------------
Commit messages:
- Backport bd6152f5967107d7b32db9bcfa224fc07314f098
Changes: https://git.openjdk.org/jdk17u-dev/pull/3852/files
Webrev: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3852&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8343855
Stats: 187 lines in 5 files changed: 149 ins; 5 del; 33 mod
Patch: https://git.openjdk.org/jdk17u-dev/pull/3852.diff
Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/3852/head:pull/3852
PR: https://git.openjdk.org/jdk17u-dev/pull/3852
More information about the jdk-updates-dev
mailing list