什么"瞬态异常"由ServiceProxy处理?

时间:2017-10-12 23:38:55

标签: c# azure-service-fabric

查看Service Remoting article,我可以看到以下内容:

  

如果发生瞬态异常,代理将重试该呼叫。

具体被视为"瞬态异常"代理人?

过去我们自己处理了Timeout,InvalidOperation(See here),FabricNotReadableException(See here)和FabricTransientExceptions以便对可靠集合进行操作 - 我们是否应该为我们的交互做同样的事情其他使用SF Remoting的服务?

举个例子:

//Get Proxy 
var serviceProxy = ServiceProxy.Create<IService>(GetServiceUri(), GetPartitionKey());
//Make Call to method which has no internal handling for transient SF failures... 
//Should this be wrapped with a retry policy?
var result = await serviceProxy.GetAll();

1 个答案:

答案 0 :(得分:0)

根据远程处理的异常处理程序(ServiceRemotingExceptionHandler.cs),似乎代理将处理以下错误:

  • 主要移动时的FabricNotPrimaryException
  • FabricTransientException例外
  • FabricNotReadableException例外

您可能仍希望自己处理超时异常。