From 7ebe738a4769638b7853cbf1a35d02f818c03b2e Mon Sep 17 00:00:00 2001 From: Artem Vysochyn Date: Mon, 15 Jun 2020 23:17:01 +0300 Subject: [PATCH 1/3] Fixed PongFrame leak --- .../io/scalecube/services/gateway/GatewayTemplate.java | 10 ---------- .../websocket/WebsocketClientConnectionTest.java | 1 + 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/services-gateway-netty/src/main/java/io/scalecube/services/gateway/GatewayTemplate.java b/services-gateway-netty/src/main/java/io/scalecube/services/gateway/GatewayTemplate.java index 66eb832c..8277f2f0 100644 --- a/services-gateway-netty/src/main/java/io/scalecube/services/gateway/GatewayTemplate.java +++ b/services-gateway-netty/src/main/java/io/scalecube/services/gateway/GatewayTemplate.java @@ -1,10 +1,8 @@ package io.scalecube.services.gateway; -import io.scalecube.services.api.ServiceMessage; import java.net.InetSocketAddress; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import reactor.core.publisher.Hooks; import reactor.core.publisher.Mono; import reactor.netty.DisposableServer; import reactor.netty.http.server.HttpServer; @@ -14,14 +12,6 @@ public abstract class GatewayTemplate implements Gateway { private static final Logger LOGGER = LoggerFactory.getLogger(GatewayTemplate.class); - static { - Hooks.onNextDropped( - obj -> { - ReferenceCountUtil.safestRelease( - obj instanceof ServiceMessage ? ((ServiceMessage) obj).data() : obj); - }); - } - protected final GatewayOptions options; protected GatewayTemplate(GatewayOptions options) { diff --git a/services-gateway-tests/src/test/java/io/scalecube/services/gateway/websocket/WebsocketClientConnectionTest.java b/services-gateway-tests/src/test/java/io/scalecube/services/gateway/websocket/WebsocketClientConnectionTest.java index 258d7516..363f688a 100644 --- a/services-gateway-tests/src/test/java/io/scalecube/services/gateway/websocket/WebsocketClientConnectionTest.java +++ b/services-gateway-tests/src/test/java/io/scalecube/services/gateway/websocket/WebsocketClientConnectionTest.java @@ -190,6 +190,7 @@ void testKeepalive() @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { if (msg instanceof PongWebSocketFrame) { + ((PongWebSocketFrame) msg).release(); keepaliveLatch.countDown(); } else { super.channelRead(ctx, msg); From 97fd15f8a49e5e66055187188eda0d408b9131bf Mon Sep 17 00:00:00 2001 From: Artem Vysochyn Date: Mon, 15 Jun 2020 23:19:50 +0300 Subject: [PATCH 2/3] Removed onNextDropped from gateway client transport --- .../gateway/transport/GatewayClientTransports.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/services-gateway-client-transport/src/main/java/io/scalecube/services/gateway/transport/GatewayClientTransports.java b/services-gateway-client-transport/src/main/java/io/scalecube/services/gateway/transport/GatewayClientTransports.java index ce605c1d..3e96efe2 100644 --- a/services-gateway-client-transport/src/main/java/io/scalecube/services/gateway/transport/GatewayClientTransports.java +++ b/services-gateway-client-transport/src/main/java/io/scalecube/services/gateway/transport/GatewayClientTransports.java @@ -2,7 +2,6 @@ import io.netty.buffer.ByteBuf; import io.rsocket.Payload; -import io.scalecube.services.api.ServiceMessage; import io.scalecube.services.gateway.transport.http.HttpGatewayClient; import io.scalecube.services.gateway.transport.http.HttpGatewayClientCodec; import io.scalecube.services.gateway.transport.rsocket.RSocketGatewayClient; @@ -12,22 +11,13 @@ import io.scalecube.services.transport.api.ClientTransport; import io.scalecube.services.transport.api.DataCodec; import io.scalecube.services.transport.api.HeadersCodec; -import io.scalecube.services.transport.api.ReferenceCountUtil; import java.util.function.Function; -import reactor.core.publisher.Hooks; public class GatewayClientTransports { private static final String CONTENT_TYPE = "application/json"; private static final HeadersCodec HEADERS_CODEC = HeadersCodec.getInstance(CONTENT_TYPE); - static { - Hooks.onNextDropped( - obj -> - ReferenceCountUtil.safestRelease( - obj instanceof ServiceMessage ? ((ServiceMessage) obj).data() : obj)); - } - public static final GatewayClientCodec WEBSOCKET_CLIENT_CODEC = new WebsocketGatewayClientCodec(DataCodec.getInstance(CONTENT_TYPE)); public static final GatewayClientCodec RSOCKET_CLIENT_CODEC = From 5649934b0d30eac414e2a97ec3d7a3fb08ac5855 Mon Sep 17 00:00:00 2001 From: Artem Vysochyn Date: Mon, 15 Jun 2020 23:40:16 +0300 Subject: [PATCH 3/3] Updated services .rc3 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3d4c367a..0c2d4b3e 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ 1.0.4 - 2.10.0-RC2 + 2.10.0-RC3 1.2.2 0.4.3 Dysprosium-SR8