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

albumenj pushed a commit to branch 3.1
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/3.1 by this push:
     new 70660cb969 fix issue: unexport() throws NPE when register fail. 
(#10893)
70660cb969 is described below

commit 70660cb9697fac3c48bcfad0f80dff7d09dbc05c
Author: pandaapo <[email protected]>
AuthorDate: Wed Nov 9 10:08:03 2022 +0800

    fix issue: unexport() throws NPE when register fail. (#10893)
---
 .../org/apache/dubbo/registry/integration/RegistryProtocol.java     | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
index 6a8449eac2..a993d8e35d 100644
--- 
a/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
+++ 
b/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
@@ -72,6 +72,7 @@ import static 
org.apache.dubbo.common.constants.CommonConstants.APPLICATION_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.CLUSTER_KEY;
 import static 
org.apache.dubbo.common.constants.CommonConstants.COMMA_SPLIT_PATTERN;
 import static org.apache.dubbo.common.constants.CommonConstants.CONSUMER;
+import static 
org.apache.dubbo.common.constants.CommonConstants.DEFAULT_SERVER_SHUTDOWN_TIMEOUT;
 import static 
org.apache.dubbo.common.constants.CommonConstants.DUBBO_VERSION_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.ENABLED_KEY;
 import static org.apache.dubbo.common.constants.CommonConstants.EXTRA_KEYS_KEY;
@@ -919,7 +920,10 @@ public class RegistryProtocol implements Protocol, 
ScopeModelAware {
             }
 
             //TODO wait for shutdown timeout is a bit strange
-            int timeout = 
ConfigurationUtils.getServerShutdownTimeout(subscribeUrl.getScopeModel());
+            int timeout = DEFAULT_SERVER_SHUTDOWN_TIMEOUT;
+            if (subscribeUrl != null) {
+                timeout = 
ConfigurationUtils.getServerShutdownTimeout(subscribeUrl.getScopeModel());
+            }
             executor.schedule(() -> {
                 try {
                     exporter.unexport();

Reply via email to