On Wed, 16 Nov 2022 18:52:42 GMT, Daniel Fuchs <dfu...@openjdk.org> wrote:

> Please find here a re-do fix for the race condition while cancelling request.
> The previous fix failed because it registered the subscriber too late (after 
> having called userSubsciber.onSubscribe()), which opened a window for the 
> call to unregister to occur before the call to register.
> This is fixed in this new iteration.

src/java.net.http/share/classes/jdk/internal/net/http/common/HttpBodySubscriberWrapper.java
 line 138:

> 136: 
> 137:     /**
> 138:      * Called right after the userSubscriber::onSubscribe is called.

Hello Daniel, I suspect this comment will need a change now, since the 
implementation in this PR now calls `onSubscribed` before the 
`userSubscriber::onSubscribe`.

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

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

Reply via email to