You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/08/11 00:32:58 UTC

[GitHub] [dubbo] startjava commented on issue #8465: 如何能看到failback失败重试的效果呢?

startjava commented on issue #8465:
URL: https://github.com/apache/dubbo/issues/8465#issuecomment-896405113


   debug了一下:
   
   并不进入FailbackClusterInvoker类中的addFailed()方法中。
       @Override
       protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
           Invoker<T> invoker = null;
           try {
               checkInvokers(invokers, invocation);
               invoker = select(loadbalance, invocation, invokers, null);
               return invokeWithContext(invoker, invocation);
           } catch (Throwable e) {
               logger.error("Failback to invoke method " + invocation.getMethodName() + ", wait for retry in background. Ignored exception: "
                       + e.getMessage() + ", ", e);
               addFailed(loadbalance, invocation, invokers, invoker);
               return AsyncRpcResult.newDefaultAsyncResult(null, null, invocation); // ignore
           }
       }
   
   提供者代码故意出现异常:
       @Override
       public String getHello(String username) {
           System.out.println("HelloService4 portValue=" + portValue);
           if (portValue == 8085) {
               throw new RuntimeException("出现异常!");
           }
           return "hello4 " + username + " port=" + portValue;
       }
   
   
   如何能执行addFailed方法呢??感谢 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org