You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Racy cancel from transport does not always cancel the message body (#2369)
Motivation:
When `cancel` from the server's transport races with HTTP message completion, we can receive `cancel` after `Single<HttpResponseMetaData>` completes but before we subscribe to the `messageBody` publisher. In this case, we won't subscribe to the `messageBody` because we use `concat` operator. This does not allow `BeforeFinallyHttpOperator` to observe a terminal event. The race is possible when offloading is enabled. `cancel` comes from an IO thread, HTTP meta-data completes on the offloaded thread.
Modifications:
- For the server-side control flow, use the recently added `concatPropagateCancel` operator to guarantee propagation of the cancel for the entire flat HTTP stream;
Result:
`HttpLifecycleObserverTest.testClientCancelsRequestBeforeResponse()` does not race anymore.
Copy file name to clipboardexpand all lines: servicetalk-http-netty/src/test/java/io/servicetalk/http/netty/RetryRequestWithNonRepeatablePayloadTest.java
+1-1
Original file line number
Diff line number
Diff line change
@@ -96,7 +96,7 @@ public Single<StreamingHttpResponse> request(StreamingHttpRequest request) {
0 commit comments