Skip to content

Commit

Permalink
https://github.com/apache/dubbo/issues/12615
Browse files Browse the repository at this point in the history
Fixing unlogged exceptions in MergeableClusterInvoker
  • Loading branch information
tohidemyname committed Jul 6, 2023
1 parent 1f84cdc commit ccfe663
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, Load
}
}
}
return invokers.iterator().next().invoke(invocation);
Invoker<T> invoker = invokers.iterator().next();
try {
return invoker.invoke(invocation);
} catch (RpcException e) {
if (e.isNoInvokerAvailableAfterFilter()) {
log.debug("No available provider for service" + getUrl().getServiceKey() + " on group " + invoker.getUrl().getParameter(GROUP_KEY) + ", will continue to try another group.");
} else {
throw e;
}
}
}

Class<?> returnType;
Expand All @@ -88,7 +97,15 @@ protected Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, Load
for (final Invoker<T> invoker : invokers) {
RpcInvocation subInvocation = new RpcInvocation(invocation, invoker);
subInvocation.setAttachment(ASYNC_KEY, "true");
results.put(invoker.getUrl().getServiceKey(), invoker.invoke(subInvocation));
try {
results.put(invoker.getUrl().getServiceKey(), invoker.invoke(subInvocation));
} catch (RpcException e) {
if (e.isNoInvokerAvailableAfterFilter()) {
log.debug("No available provider for service" + getUrl().getServiceKey() + " on group " + invoker.getUrl().getParameter(GROUP_KEY) + ", will continue to try another group.");
} else {
throw e;
}
}
}

Object result = null;
Expand Down

0 comments on commit ccfe663

Please sign in to comment.