You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/12/20 08:36:06 UTC

[dubbo] branch fix-netutils-log-endless-recursive created (now 8af951f)

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

liujun pushed a change to branch fix-netutils-log-endless-recursive
in repository https://gitbox.apache.org/repos/asf/dubbo.git.


      at 8af951f  Fixes https://github.com/apache/dubbo/pull/4225

This branch includes the following new commits:

     new d48de32  Fixes #4992, endless recursive call when NetUtils method fails.
     new 8af951f  Fixes https://github.com/apache/dubbo/pull/4225

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[dubbo] 01/02: Fixes #4992, endless recursive call when NetUtils method fails.

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch fix-netutils-log-endless-recursive
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit d48de32b6d92a68af6a7a3d9cde27539e26e08cb
Author: ken.lj <ke...@gmail.com>
AuthorDate: Fri Dec 20 16:22:46 2019 +0800

    Fixes #4992, endless recursive call when NetUtils method fails.
---
 .../src/main/java/org/apache/dubbo/common/utils/NetUtils.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
index e5057e8..5c3f9a5 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/NetUtils.java
@@ -20,6 +20,7 @@ import org.apache.dubbo.common.URL;
 import org.apache.dubbo.common.config.ConfigurationUtils;
 import org.apache.dubbo.common.logger.Logger;
 import org.apache.dubbo.common.logger.LoggerFactory;
+import org.apache.dubbo.common.logger.support.FailsafeLogger;
 
 import java.io.IOException;
 import java.net.Inet4Address;
@@ -45,7 +46,14 @@ import static org.apache.dubbo.common.constants.CommonConstants.LOCALHOST_VALUE;
  * IP and Port Helper for RPC
  */
 public class NetUtils {
-    private static final Logger logger = LoggerFactory.getLogger(NetUtils.class);
+    private static Logger logger;
+
+    {
+        logger = LoggerFactory.getLogger(NetUtils.class);
+        if (logger instanceof FailsafeLogger) {
+            logger = ((FailsafeLogger) logger).getLogger();
+        }
+    }
 
     // returned port range is [30000, 39999]
     private static final int RND_PORT_START = 30000;


[dubbo] 02/02: Fixes https://github.com/apache/dubbo/pull/4225

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch fix-netutils-log-endless-recursive
in repository https://gitbox.apache.org/repos/asf/dubbo.git

commit 8af951f7ebde761c0fad32f52c95c1c6f8331553
Author: ken.lj <ke...@gmail.com>
AuthorDate: Fri Dec 20 16:35:18 2019 +0800

    Fixes https://github.com/apache/dubbo/pull/4225
---
 .../src/main/java/org/apache/dubbo/config/AbstractConfig.java     | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java
index c86183e..a88df5c 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/config/AbstractConfig.java
@@ -511,6 +511,14 @@ public abstract class AbstractConfig implements Serializable {
                     if (MethodUtils.isGetter(method)) {
                         String name = method.getName();
                         String key = calculateAttributeFromGetter(name);
+
+                        try {
+                            getClass().getField(key);
+                        } catch (NoSuchFieldException e) {
+                            // ignore
+                            continue;
+                        }
+
                         Object value = method.invoke(this);
                         if (value != null) {
                             buf.append(" ");