RFR: 8208693: HttpClient: Extend the request timeout's scope to cover the response body [v5]
Volkan Yazici
vyazici at openjdk.org
Mon Nov 3 11:36:48 UTC 2025
On Thu, 30 Oct 2025 14:43:36 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:
>> Volkan Yazici has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Replace wrapper's `preTerminationCallback` argument with a method to be extended
>
> src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java line 79:
>
>> 77: * A callback to be invoked before termination, whether due to the
>> 78: * completion or failure of the subscriber, or cancellation of the
>> 79: * subscription.
>
> I'd suggest to also say that when a subscription is cancelled, onTermination() is called before onCancel().
Improved docs in 7c989980e19.
> src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java line 102:
>
>> 100: } finally {
>> 101: if (markCancelled()) {
>> 102: onTermination();
>
> I was wondering if it would be better to have the subclasses call the appropriate method from `onCancel()` rather than have both `cancel()` and `complete()` call `onTermination()`.
> However - thinking about it again, I believe that calling onTermination() from cancel() is the right call.
>
> FWIW - we should also make the private class `SubscriptionWrapper` final.
Marked `SubscriptionWrapper` as `final` in 02d2b5468e9.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486158926
PR Review Comment: https://git.openjdk.org/jdk/pull/27469#discussion_r2486159462
More information about the net-dev
mailing list