RFR: 8277969: HttpClient SelectorManager shuts down when custom Executor rejects a task
Daniel Fuchs
dfuchs at openjdk.java.net
Mon Jan 24 14:32:37 UTC 2022
This changes makes sure that pending requests are terminated if the selector manager thread exits due to exceptions.
This includes:
1. completing CompletableFutures that were returned to the caller code
2. cancelling requests that are in flight
3. calling onError on BodySubscribers that may not have been completed
Note that step 3 is necessary as certain CompletableFutures, such as those returned by `BodySubscribers.ofInputStream`, complete immediately, the operation being eventually completed when the last bite of the response is read. Completing a completable future that is already completed has no effect, this case is handled by completing the BodySubscriber too.
-------------
Commit messages:
- 8277969: HttpClient SelectorManager shuts down when custom Executor rejects a task
Changes: https://git.openjdk.java.net/jdk/pull/7196/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=7196&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8277969
Stats: 1979 lines in 23 files changed: 1714 ins; 140 del; 125 mod
Patch: https://git.openjdk.java.net/jdk/pull/7196.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/7196/head:pull/7196
PR: https://git.openjdk.java.net/jdk/pull/7196
More information about the net-dev
mailing list