From f6c6a9f3b2e021774c498eab79d11c7e8b71fed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BB=B6?= <1060026287@qq.com> Date: Wed, 30 Sep 2020 13:14:42 +0800 Subject: [PATCH] [ISSUE #3850] ignore socket exception when client destroy already (#3906) * if client destroy already, ignore socket exception. * remove the exception's judgement * remove unuseful import --- .../com/alibaba/nacos/client/naming/core/PushReceiver.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/core/PushReceiver.java b/client/src/main/java/com/alibaba/nacos/client/naming/core/PushReceiver.java index 625fb12d2..3a0776d46 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/core/PushReceiver.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/core/PushReceiver.java @@ -107,6 +107,9 @@ public class PushReceiver implements Runnable, Closeable { udpSocket.send(new DatagramPacket(ack.getBytes(UTF_8), ack.getBytes(UTF_8).length, packet.getSocketAddress())); } catch (Exception e) { + if (closed) { + return; + } NAMING_LOGGER.error("[NA] error while receiving push data", e); } }