From f179b8f1f82d8adf1e00832c6329160147961f07 Mon Sep 17 00:00:00 2001 From: Matt Wistrand Date: Sun, 30 Aug 2026 11:26:46 -0500 Subject: [PATCH] fix(websocket): prevent loss of early backend frames --- .../java/aussie/adapter/in/websocket/WebSocketGateway.java | 3 +++ cli/.tool-versions | 1 + 2 files changed, 4 insertions(+) create mode 100644 cli/.tool-versions diff --git a/api/src/main/java/aussie/adapter/in/websocket/WebSocketGateway.java b/api/src/main/java/aussie/adapter/in/websocket/WebSocketGateway.java index bc5ba00..ffa1eaf 100644 --- a/api/src/main/java/aussie/adapter/in/websocket/WebSocketGateway.java +++ b/api/src/main/java/aussie/adapter/in/websocket/WebSocketGateway.java @@ -338,6 +338,8 @@ private void establishProxy(RoutingContext ctx, WebSocketUpgradeResult.Authorize httpClient .webSocket(options) .onSuccess(backendWs -> { + // Hold backend frames until the client upgrade has installed the proxy. + backendWs.pause(); if (draining.get()) { backendWs.close((short) 1001, "Server shutting down"); releaseConnection.run(); @@ -409,6 +411,7 @@ private void establishProxy(RoutingContext ctx, WebSocketUpgradeResult.Authorize metrics.incrementActiveWebSockets(); metrics.recordWebSocketConnect(serviceId); managedSession.start(); + backendWs.resume(); } LOG.infov( diff --git a/cli/.tool-versions b/cli/.tool-versions new file mode 100644 index 0000000..e579f50 --- /dev/null +++ b/cli/.tool-versions @@ -0,0 +1 @@ +java openjdk-21.0.1