faq-cluster (#10561)

faq-cluster
This commit is contained in:
xin gu 2022-09-06 15:48:30 +08:00 committed by GitHub
parent 6ebcb9d8d6
commit daa4d8eb2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 10 deletions

View File

@ -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();
}
}

View File

@ -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);
}
}
}

View File

@ -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
}
}