RFR: 8294916: Cancelling a request must eventually cause its response body subscriber to be unregistered [v6]

Daniel Fuchs dfuchs at openjdk.org
Tue Oct 18 13:44:40 UTC 2022


On Tue, 18 Oct 2022 09:05:15 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> Daniel Fuchs has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update copyright years
>
> src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java line 88:
> 
>> 86:             } catch (Throwable t) {
>> 87:                 onError(t);
>> 88:             }
> 
> Thank you for making this change. Do you think, we should only call `onError()` if `subscription.cancel()` fails? In its current form above, it will end up calling the `onError()` if the `onCancel()` fails for whatever reason.

onCancel is not supposed to fail - and we really want the cleanup to be performed so I believe it's fair to call onError in that case.

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

PR: https://git.openjdk.org/jdk/pull/10659


More information about the net-dev mailing list