Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query converts TaskCanceledException to InternalServerError #2065

Closed
j82w opened this issue Dec 15, 2020 · 1 comment
Closed

Query converts TaskCanceledException to InternalServerError #2065

j82w opened this issue Dec 15, 2020 · 1 comment
Assignees
Labels
bug Something isn't working Hotfix A hotfix is required for the issue QUERY

Comments

@j82w
Copy link
Contributor

j82w commented Dec 15, 2020

There is a bug in the query code where it is converting the TaskCanceledException into a InternalServerError. The conversion is also not include the CosmosDiagnostics so it is not possible to see what is causing the TaskCanceledException.

Example exception:

Failure during tenant set refresh Microsoft.Azure.Cosmos.CosmosException: Response status code does not indicate success: InternalServerError (500); Substatus: 0; ActivityId: 00000000-0000-0000-0000-000000000000; Reason: (A task was canceled.); ---> 
(Inner) System.Threading.Tasks.TaskCanceledException: A task was canceled. at await 
Microsoft.Azure.Cosmos.ClientExtensions.GetAsync(?) at await 
Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.GetServerAddressesViaGatewayAsync(?) at await 
Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.GetAddressesForRangeIdAsync(?) at await 
Microsoft.Azure.Cosmos.Common.AsyncCache`2.GetAsync<TKey,TValue>(?) at await 
Microsoft.Azure.Cosmos.Routing.GatewayAddressCache.TryGetAddressesAsync(?) at await 
Microsoft.Azure.Cosmos.AddressResolver.TryResolveServerPartitionByPartitionKeyRangeIdAsync(?) at await 
Microsoft.Azure.Cosmos.AddressResolver.TryResolveServerPartitionAsync(?) at await 
Microsoft.Azure.Cosmos.AddressResolver.ResolveAddressesAndIdentityAsync(?) at await 
Microsoft.Azure.Cosmos.AddressResolver.ResolveAsync(?) at await 
Microsoft.Azure.Documents.AddressSelector.ResolveAddressesAsync(?) at await 
Microsoft.Azure.Documents.AddressSelector.ResolveAllUriAsync(?) at await 
Microsoft.Azure.Documents.StoreReader.ReadMultipleReplicasInternalAsync(?) at await 
Microsoft.Azure.Documents.StoreReader.ReadMultipleReplicaAsync(?) at await 
Microsoft.Azure.Documents.QuorumReader.ReadQuorumAsync(?) at await 
Microsoft.Azure.Documents.QuorumReader.ReadStrongAsync(?) at await 
Microsoft.Azure.Documents.ReplicatedResourceClient.>c__DisplayClass26_0+<<InvokeAsync>b__0(?) at await 
Microsoft.Azure.Documents.RequestRetryUtility.ProcessRequestAsync<TRequest,IRetriableResponse>(?) at 
Microsoft.Azure.Documents.ShouldRetryResult.ThrowIfDoneTrying(ExceptionDispatchInfo capturedException) at await 
Microsoft.Azure.Documents.RequestRetryUtility.ProcessRequestAsync<TRequest,IRetriableResponse>(?) at await 
Microsoft.Azure.Documents.StoreClient.ProcessMessageAsync(?) at await 
Microsoft.Azure.Documents.ServerStoreModel.ProcessMessageAsync(?) at await 
Microsoft.Azure.Cosmos.Handlers.TransportHandler.ProcessMessageAsync(?) at await 
Microsoft.Azure.Cosmos.Handlers.TransportHandler.SendAsync(?) at await Microsoft.Azure.Cosmos.RequestHandler.SendAsync(?) 
at await Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.ExecuteHttpRequestAsync(?) at await 
Microsoft.Azure.Cosmos.Handlers.AbstractRetryHandler.SendAsync(?) at await 
Microsoft.Azure.Cosmos.RequestHandler.SendAsync(?) at await Microsoft.Azure.Cosmos.RequestHandler.SendAsync(?) at await 
Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler.SendAsync(?) at await 
Microsoft.Azure.Cosmos.Handlers.RequestInvokerHandler.SendAsync(?) at await 
Microsoft.Azure.Cosmos.CosmosQueryClientCore.ExecuteItemQueryAsync(?) at await 
Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.ItemProducers.ItemProducer.BufferMoreDocumentsAsync(?) at await 
Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.ItemProducers.ItemProducer.BufferMoreIfEmptyAsync(?) at await 
Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.ItemProducers.ItemProducer.TryMoveNextPageAsync(?) at await 
Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.ItemProducers.ItemProducerTree.TryMoveNextPageImplementationAsync(?) 
at await Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.ItemProducers.ItemProducerTree.ExecuteWithSplitProofingAsync(?) 
at await Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.ItemProducers.ItemProducerTree.TryMoveNextPageAsync(?) at 
await Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.Parallel.CosmosParallelItemQueryExecutionContext.DrainAsync(?) at 
await Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.PipelinedDocumentQueryExecutionContext.ExecuteNextAsync(?) at 
await Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.LazyCosmosQueryExecutionContext.ExecuteNextAsync(?) at await 
Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.CosmosQueryExecutionContextWithNameCacheStaleRetry.ExecuteNextAsync(?) at await Microsoft.Azure.Cosmos.Query.Core.ExecutionContext.CatchAllCosmosQueryExecutionContext.ExecuteNextAsync(?) 
<--- at Microsoft.Azure.Cosmos.ResponseMessage.EnsureSuccessStatusCode() at Microsoft.Azure.Cosmos.ReadFeedResponse`1.CreateResponse<TInput>(ResponseMessage responseMessage, 
CosmosSerializerCore serializerCore) at await Microsoft.Azure.Cosmos.FeedIteratorCore`1.ReadNextAsync<T>(?) at await
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Hotfix A hotfix is required for the issue QUERY
Projects
None yet
Development

No branches or pull requests

2 participants