[BUG] Unable to catch Exception due to indefinite retry
See original GitHub issueDescribe the bug I’m unable to catch the exception because it seems to retry indefinitely.
Exception or Stack Trace None.
Code Snippet
// https://docs.microsoft.com/en-us/dotnet/azure/dotnet-sdk-azure-concepts?view=azure-dotnet#logs-and-tracing
ServiceClientTracing.AddTracingInterceptor(new ConsoleTracer());
ServiceClientTracing.IsEnabled = true;
var azure = Azure
.Configure()
.WithDelegatingHandler(new HttpLoggingDelegatingHandler())
.WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
.Authenticate(credentials)
.WithDefaultSubscription();
var webApp = azure.WebApps.GetByResourceGroup("rgName", "webAppName");
try
{
webApp.Update()
.DefineHostnameBinding()
.WithThirdPartyDomain("foobar.com")
.WithSubDomain("@")
.WithDnsRecordType(CustomHostNameDnsRecordType.A)
.Attach()
.Apply();
}
catch (RestException exception){
// never gets here.
}
Expected behavior A raised exception of any kind can be caught by client code.
Setup (please complete the following information):
- OS: Windows
- IDE : LinqPad
- Version of the Library used: 1.22
Additional context Even when i add a RetryPolicy
.WithRetryPolicy(new RetryPolicy(new HttpStatusCodeErrorDetectionStrategy(), new FixedIntervalRetryStrategy(0)))
or try to remove the default one
.WithRetryPolicy(null)
It seems to be ignored.
The DefaultErrorResponseException is logged to the console
“Microsoft.Azure.Management.AppService.Fluent.Models.DefaultErrorResponseException: Operation returned an invalid status code ‘BadRequest’”
over and over again with unique invocation ids.
Information Checklist Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [ x] Bug Description Added
- [x ] Repro Steps Added
- [x ] Setup information Added
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
@ai-fwd @synercoder The issue in AppService is fixed through https://github.com/Azure/azure-libraries-for-net/issues/646 PR https://github.com/Azure/azure-libraries-for-net/pull/841
@kurtzeborn, this is not an App Services issue. This seems to be a general problem with the Fluent SDK. The following code also reproduces the same issue. The underlying API returns a 400 with PrincipalNotFound, but the SDK continues retrying indefinitely.