This is an automated email from the ASF dual-hosted git repository.

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new 7f5fd46      #2762: [Dubbo - qos-http] stopServer should be invoked ? 
(#2767)
7f5fd46 is described below

commit 7f5fd469ee44cc2802194cbecde48d7d1fc920e4
Author: Ian Luo <[email protected]>
AuthorDate: Fri Nov 9 16:31:42 2018 +0800

        #2762: [Dubbo - qos-http] stopServer should be invoked ? (#2767)
---
 .../java/org/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 5c83ab0..6c2fbae 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 class QosProtocolWrapper implements Protocol {
     @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 @@ public class QosProtocolWrapper implements Protocol {
                 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();

Reply via email to