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 daa4d8eb2e faq-cluster (#10561)
daa4d8eb2e is described below
commit daa4d8eb2e5290f1100d32ed0b93896e10fe7ca7
Author: xin gu <[email protected]>
AuthorDate: Tue Sep 6 15:48:30 2022 +0800
faq-cluster (#10561)
faq-cluster
---
.../org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java | 6 +++---
.../cluster/router/condition/config/ListenableStateRouter.java | 8 ++++----
.../apache/dubbo/rpc/cluster/support/FailsafeClusterInvoker.java | 6 +++---
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java
index 58a246204b..cc35d2cbff 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/directory/StaticDirectory.java
@@ -17,7 +17,7 @@
package org.apache.dubbo.rpc.cluster.directory;
import org.apache.dubbo.common.URL;
-import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.rpc.Invocation;
@@ -32,7 +32,7 @@ import java.util.List;
* StaticDirectory
*/
public class StaticDirectory<T> extends AbstractDirectory<T> {
- private static final Logger logger =
LoggerFactory.getLogger(StaticDirectory.class);
+ private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(StaticDirectory.class);
public StaticDirectory(List<Invoker<T>> invokers) {
this(null, invokers, null);
@@ -108,7 +108,7 @@ public class StaticDirectory<T> extends
AbstractDirectory<T> {
List<Invoker<T>> finalInvokers =
routerChain.route(getConsumerUrl(), invokers, invocation);
return finalInvokers == null ? BitList.emptyList() :
finalInvokers;
} catch (Throwable t) {
- logger.error("Failed to execute router: " + getUrl() + ",
cause: " + t.getMessage(), t);
+ logger.error("2-1","Failed to execute router","","Failed to
execute router: " + getUrl() + ", cause: " + t.getMessage(),t);
return BitList.emptyList();
}
}
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableStateRouter.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableStateRouter.java
index c295a66d5b..ff6af3c467 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableStateRouter.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableStateRouter.java
@@ -21,7 +21,7 @@ import
org.apache.dubbo.common.config.configcenter.ConfigChangeType;
import org.apache.dubbo.common.config.configcenter.ConfigChangedEvent;
import org.apache.dubbo.common.config.configcenter.ConfigurationListener;
import org.apache.dubbo.common.config.configcenter.DynamicConfiguration;
-import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.Holder;
@@ -48,7 +48,7 @@ public abstract class ListenableStateRouter<T> extends
AbstractStateRouter<T> im
public static final String NAME = "LISTENABLE_ROUTER";
private static final String RULE_SUFFIX = ".condition-router";
- private static final Logger logger =
LoggerFactory.getLogger(ListenableStateRouter.class);
+ private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(ListenableStateRouter.class);
private volatile ConditionRouterRule routerRule;
private volatile List<ConditionStateRouter<T>> conditionRouters =
Collections.emptyList();
private String ruleKey;
@@ -75,8 +75,8 @@ public abstract class ListenableStateRouter<T> extends
AbstractStateRouter<T> im
routerRule = ConditionRuleParser.parse(event.getContent());
generateConditions(routerRule);
} catch (Exception e) {
- logger.error("Failed to parse the raw condition rule and it
will not take effect, please check " +
- "if the condition rule matches with the template, the
raw rule is:\n " + event.getContent(), e);
+ logger.error("2-15","Failed to parse the raw condition
rule","","Failed to parse the raw condition rule and it will not take effect,
please check " +
+ "if the condition rule matches with the template, the raw
rule is:\n " + event.getContent(),e);
}
}
}
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailsafeClusterInvoker.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailsafeClusterInvoker.java
index edc9ec5ee3..33aa5d09ed 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailsafeClusterInvoker.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/FailsafeClusterInvoker.java
@@ -16,7 +16,7 @@
*/
package org.apache.dubbo.rpc.cluster.support;
-import org.apache.dubbo.common.logger.Logger;
+import org.apache.dubbo.common.logger.ErrorTypeAwareLogger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.rpc.AsyncRpcResult;
import org.apache.dubbo.rpc.Invocation;
@@ -36,7 +36,7 @@ import java.util.List;
*
*/
public class FailsafeClusterInvoker<T> extends AbstractClusterInvoker<T> {
- private static final Logger logger =
LoggerFactory.getLogger(FailsafeClusterInvoker.class);
+ private static final ErrorTypeAwareLogger logger =
LoggerFactory.getErrorTypeAwareLogger(FailsafeClusterInvoker.class);
public FailsafeClusterInvoker(Directory<T> directory) {
super(directory);
@@ -49,7 +49,7 @@ public class FailsafeClusterInvoker<T> extends
AbstractClusterInvoker<T> {
Invoker<T> invoker = select(loadbalance, invocation, invokers,
null);
return invokeWithContext(invoker, invocation);
} catch (Throwable e) {
- logger.error("Failsafe ignore exception: " + e.getMessage(), e);
+ logger.error("2-8","Failsafe for provider exception","","Failsafe
ignore exception: " + e.getMessage(),e);
return AsyncRpcResult.newDefaultAsyncResult(null, null,
invocation); // ignore
}
}