From 8348263fab2d9f136d8f10a36c1f00413112c94c Mon Sep 17 00:00:00 2001 From: Chris Eager Date: Thu, 7 Sep 2023 14:51:31 -0500 Subject: [PATCH] Set `suppressCancel=true` in `Mono.fromFuture` --- .../textsecuregcm/websocket/WebSocketConnection.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/websocket/WebSocketConnection.java b/service/src/main/java/org/whispersystems/textsecuregcm/websocket/WebSocketConnection.java index b64bf7196..d2e0cc4e9 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/websocket/WebSocketConnection.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/websocket/WebSocketConnection.java @@ -360,7 +360,10 @@ public class WebSocketConnection implements MessageAvailabilityListener, Displac .limitRate(MESSAGE_PUBLISHER_LIMIT_RATE) .flatMapSequential(envelope -> Mono.fromFuture(() -> sendMessage(envelope) - .orTimeout(sendFuturesTimeoutMillis, TimeUnit.MILLISECONDS)) + .orTimeout(sendFuturesTimeoutMillis, TimeUnit.MILLISECONDS), + // suppressCancel=true, because attempting to cancel the future has no effect, other than + // causing dropped errors + true) .onErrorResume( // let the first error pass through to terminate the subscription e -> {