[JDK-8342075](https://bugs.openjdk.org/browse/JDK-8342075) has introduced more flow controls checks, but also introduced a race condition where DataFrames for closed streams may fail to be discounted from the connection window.
The consequence is that WINDOW_UPDATE frames for the connection window may not be sent when they should, preventing the server from making progress and stalling the connection. This can be shown by modifying the StreamFlowControlTest to send less but bigger frames (e.g. chunks of 1600 bytes instead of chunks of 12 bytes). With such a modification the test can be seen failing intermittently, when sameClient=true. The race happens when frames that have been added to Stream::inputQ fail to be drained after the stream is closed (or continue to be added to the inputQ after the stream is closed). The fix ensures that Stream::drainInputQueue() is called when the stream is closed, and that no further data farme will be added to the inputQ after the stream is marked closed. ------------- Commit messages: - Add missing bug id - 8342075: HTTP/2 ConnectionWindowUpdateSender may miss some unprocessed DataFrames from closed streams Changes: https://git.openjdk.org/jdk/pull/21991/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21991&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8342075 Stats: 157 lines in 5 files changed: 121 ins; 4 del; 32 mod Patch: https://git.openjdk.org/jdk/pull/21991.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/21991/head:pull/21991 PR: https://git.openjdk.org/jdk/pull/21991