Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 7ebe738

Browse files
committed
Fixed PongFrame leak
1 parent 01b9a3e commit 7ebe738

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

services-gateway-netty/src/main/java/io/scalecube/services/gateway/GatewayTemplate.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package io.scalecube.services.gateway;
22

3-
import io.scalecube.services.api.ServiceMessage;
43
import java.net.InetSocketAddress;
54
import org.slf4j.Logger;
65
import org.slf4j.LoggerFactory;
7-
import reactor.core.publisher.Hooks;
86
import reactor.core.publisher.Mono;
97
import reactor.netty.DisposableServer;
108
import reactor.netty.http.server.HttpServer;
@@ -14,14 +12,6 @@ public abstract class GatewayTemplate implements Gateway {
1412

1513
private static final Logger LOGGER = LoggerFactory.getLogger(GatewayTemplate.class);
1614

17-
static {
18-
Hooks.onNextDropped(
19-
obj -> {
20-
ReferenceCountUtil.safestRelease(
21-
obj instanceof ServiceMessage ? ((ServiceMessage) obj).data() : obj);
22-
});
23-
}
24-
2515
protected final GatewayOptions options;
2616

2717
protected GatewayTemplate(GatewayOptions options) {

services-gateway-tests/src/test/java/io/scalecube/services/gateway/websocket/WebsocketClientConnectionTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ void testKeepalive()
190190
@Override
191191
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
192192
if (msg instanceof PongWebSocketFrame) {
193+
((PongWebSocketFrame) msg).release();
193194
keepaliveLatch.countDown();
194195
} else {
195196
super.channelRead(ctx, msg);

0 commit comments

Comments
 (0)