From 2356420ef1ba7684f4dbd2139465f3630e0ea801 Mon Sep 17 00:00:00 2001 From: Ian Luo Date: Fri, 9 Nov 2018 16:31:42 +0800 Subject: [PATCH] #2762: [Dubbo - qos-http] stopServer should be invoked ? (#2767) --- .../apache/dubbo/qos/protocol/QosProtocolWrapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/protocol/QosProtocolWrapper.java b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/protocol/QosProtocolWrapper.java index 5c83ab060561..6c2fbaed91e1 100644 --- a/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/protocol/QosProtocolWrapper.java +++ b/dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/protocol/QosProtocolWrapper.java @@ -75,13 +75,10 @@ public Invoker refer(Class type, URL url) throws RpcException { @Override public void destroy() { protocol.destroy(); + stopServer(); } private void startQosServer(URL url) { - if (!hasStarted.compareAndSet(false, true)) { - return; - } - try { boolean qosEnable = url.getParameter(QOS_ENABLE,true); if (!qosEnable) { @@ -91,6 +88,10 @@ private void startQosServer(URL url) { return; } + if (!hasStarted.compareAndSet(false, true)) { + return; + } + int port = url.getParameter(QOS_PORT, QosConstants.DEFAULT_PORT); boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter(ACCEPT_FOREIGN_IP,"false")); Server server = Server.getInstance();