From 1b9e1db3519b00a7791b572b5e618dd9c43f983c Mon Sep 17 00:00:00 2001 From: jzdayz <1397649957@qq.com> Date: Thu, 27 Feb 2020 14:33:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/alibaba/nacos/naming/push/PushService.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java b/naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java index b5a0ffb39..ea726d1b8 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java @@ -317,8 +317,6 @@ public class PushService implements ApplicationContextAware, ApplicationListener try { packet = new DatagramPacket(dataBytes, dataBytes.length, client.socketAddr); Receiver.AckEntry ackEntry = new Receiver.AckEntry(key, packet); - ackEntry.data = data; - // we must store the key be fore send, otherwise there will be a chance the // ack returns before we put in ackEntry.data = data; From deab304d5bc45c0740b82e678a25ab1f7c65063d Mon Sep 17 00:00:00 2001 From: jzdayz <1397649957@qq.com> Date: Thu, 27 Feb 2020 14:41:25 +0800 Subject: [PATCH 2/2] fix log error --- .../main/java/com/alibaba/nacos/naming/push/PushService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java b/naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java index ea726d1b8..d2f5d134f 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/push/PushService.java @@ -647,7 +647,7 @@ public class PushService implements ApplicationContextAware, ApplicationListener try { udpSocket.receive(packet); - String json = new String(packet.getData(), 0, packet.getLength(), Charset.forName("UTF-8")).trim(); + String json = new String(packet.getData(), 0, packet.getLength(), StandardCharsets.UTF_8).trim(); AckPacket ackPacket = JSON.parseObject(json, AckPacket.class); InetSocketAddress socketAddress = (InetSocketAddress) packet.getSocketAddress(); @@ -667,7 +667,7 @@ public class PushService implements ApplicationContextAware, ApplicationListener long pushCost = System.currentTimeMillis() - udpSendTimeMap.get(ackKey); - Loggers.PUSH.info("received ack: {} from: {}:, cost: {} ms, unacked: {}, total push: {}", + Loggers.PUSH.info("received ack: {} from: {}:{}, cost: {} ms, unacked: {}, total push: {}", json, ip, port, pushCost, ackMap.size(), totalPush); pushCostMap.put(ackKey, pushCost);