diff --git a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/Endpoints.java b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/Endpoints.java index f3ca9d9247cd7..26bf46d6421a8 100644 --- a/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/Endpoints.java +++ b/extensions/websockets-next/runtime/src/main/java/io/quarkus/websockets/next/runtime/Endpoints.java @@ -261,6 +261,9 @@ private static void handleFailure(UnhandledFailureStrategy strategy, Throwable c } private static void closeConnection(Throwable cause, WebSocketConnectionBase connection) { + if (connection.isClosed()) { + return; + } connection.close(CloseReason.INTERNAL_SERVER_ERROR).subscribe().with( v -> LOG.debugf("Connection closed due to unhandled failure %s: %s", cause, connection), t -> LOG.errorf("Unable to close connection [%s] due to unhandled failure [%s]: %s", connection.id(), cause,