[jdk17u-dev] RFR: 8316580: HttpClient with StructuredTaskScope does not close when a task fails [v3]
Goetz Lindenmaier
goetz at openjdk.org
Fri Jul 18 08:18:48 UTC 2025
> I backport this for parity with 17.0.17-oracle.
>
> The change applies clean, but the test does not work out-of-the-box.
>
> It calls some utility methods ReferenceTracker.java that were added by JDK-8305847.
> That change is not in the current list of backports, so I added the utility methods
> to this change.
>
> Further, the test depends on the fact that in 21 a row of classes implement
> AutoClosable, which they don't do in 21.
> I adapted a row of places to work around this.
> A try-with-resources statement was easy to replace, as the missing
> close() implementation uses public methods, so that I could copy the
> code to the test.
> In TestTaskScope I replaced close() by shutdownNow().
> Finally I removed the "useReferenceTracker=false" test variant, as the
> HttpClient implementation is quite far off of the implementation in 21.
Goetz Lindenmaier has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
- Call shutdownNow in TestTaskScope.close()
- Merge branch 'master' into goetz_backport_8316580
- more graceful close() implementation
- Adapt test to missing AutoClosable etc.
- Parts of 8305847
- Backport d8291f593762ab270bf05643b87c57578d716242
-------------
Changes:
- all: https://git.openjdk.org/jdk17u-dev/pull/3706/files
- new: https://git.openjdk.org/jdk17u-dev/pull/3706/files/622ef2fd..9abc3cb0
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3706&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk17u-dev&pr=3706&range=01-02
Stats: 4048 lines in 193 files changed: 2151 ins; 926 del; 971 mod
Patch: https://git.openjdk.org/jdk17u-dev/pull/3706.diff
Fetch: git fetch https://git.openjdk.org/jdk17u-dev.git pull/3706/head:pull/3706
PR: https://git.openjdk.org/jdk17u-dev/pull/3706
More information about the jdk-updates-dev
mailing list