[jdk20] RFR: 8298340: java/net/httpclient/CancelRequestTest.java fails with AssertionError: Found some subscribers for testPostInterrupt

Daniel Fuchs dfuchs at openjdk.org
Thu Dec 8 18:38:38 UTC 2022


There are several ways by which an HTTP/2 stream can be closed. Due to the built-in asynchronous behavior, and to avoid unnecessary churn when a request is cancelled/aborted there are two places where the boolean stream's state closed can be set to true: cancelImpl and close. The current code completes the subscriber in cancelImpl, but the subscriber should also be completed in close. The intermittent failure happens if close gets ever called before cancelImpl.
This patch fixes that.

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

Commit messages:
 - Merge branch 'master' of https://github.com/dfuch/jdk20 into 8298340
 - Fix typo
 - 8298340

Changes: https://git.openjdk.org/jdk20/pull/3/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk20&pr=3&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8298340
  Stats: 62 lines in 4 files changed: 57 ins; 1 del; 4 mod
  Patch: https://git.openjdk.org/jdk20/pull/3.diff
  Fetch: git fetch https://git.openjdk.org/jdk20 pull/3/head:pull/3

PR: https://git.openjdk.org/jdk20/pull/3


More information about the net-dev mailing list