-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WriteStreamSubscriber
: don't interact with Subscription after termi…
…nal (#2276) Motivation: #1838 marks `WriteStreamSubscriber.this.subscription` as `CANCELLED` when source terminates. It covered one use-case (cancel after terminal), but does not cover another use-case (request after terminal) introduced later in #1850 due to race between a thread that emits a terminal signal and the event-loop. Modifications: - Mark `WriteStreamSubscriber.this.subscription` as `CANCELLED` before `promise.sourceTerminated` is scheduled on the event-loop; Result: No more interactions with the subscription after terminal signal is received. Technically, race is still possible if a terminal signal is delayed, but the time window is lower now. It also resolves a flaky test `HttpLifecycleObserverTest.testCompleteWithPayloadBodyAndTrailers` that may observe `onRequestDataRequested` after `onRequestComplete`. Due to offloading, `onRequestDataRequested` may be observed significantly later than response completes and verification starts.
- Loading branch information
1 parent
06281ef
commit 68b8609
Showing
1 changed file
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters