-
Notifications
You must be signed in to change notification settings - Fork 494
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
CosmosDiagnostics throws IndexOutOfRangeException #2075
Comments
@LiDamon any chance you can provide a simple console app that reproduce the issue? If not can you please provide the query, query request options, and any other custom settings you have configured for the SDK? |
This is my code
This is index json BTW , we before used 3.12 don't found this issue. Upgrade to 3.15 found it. So we plan downgrade to 3.12 |
I add retry logic, Won't show up exception the second time. But this error occurs very frequently. |
@LiDamon what is the reason for doing the Task.Run? Why not just use a cancellation token with a timeout? |
The main reason is here: |
We want get count about all partition with special filter, but have an error
Message:System.AggregateException: One or more errors occurred. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Microsoft.Azure.Cosmos.CosmosDiagnosticsContextCore.d__42.MoveNext()
at System.Collections.Generic.List
1.InsertRange(Int32 index, IEnumerable
1 collection)at Microsoft.Azure.Cosmos.CosmosDiagnosticsContextCore.AddDiagnosticsInternal(CosmosDiagnosticsContext newContext)
at Microsoft.Azure.Cosmos.Query.QueryIterator.d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.Cosmos.FeedIteratorCore
1.<ReadNextAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Test.CosmosIndexDocService.<>c__DisplayClass34_0.<<GetCount>b__0>d.MoveNext() in C:\CosmosIndexDocService.cs:line 980 --- End of inner exception stack trace --- at Test.CosmosIndexDocService.GetCount() in C:\CosmosIndexDocService.cs:line 993 at CosmosService.SPIndexService.GetUserGranPermissionCount() in C:\SPIndexService.cs:line 2284 at Test.GetSensitivityCount(String tenantId, String logonName, String dorid, DataModule module, SensitiveLevel sensitiveLevel, MemberType type) in C:\\AggUsersRelation.cs:line 409 at GetUseGroupAccess(UsersRelationInfo user, MemberType type) in C:\Aggregate\AggUsersRelation.cs:line 285 ---> (Inner Exception #0) System.IndexOutOfRangeException: Index was outside the bounds of the array. at Microsoft.Azure.Cosmos.CosmosDiagnosticsContextCore.<GetEnumerator>d__42.MoveNext() at System.Collections.Generic.List
1.InsertRange(Int32 index, IEnumerable1 collection) at Microsoft.Azure.Cosmos.CosmosDiagnosticsContextCore.AddDiagnosticsInternal(CosmosDiagnosticsContext newContext) at Microsoft.Azure.Cosmos.Query.QueryIterator.<ReadNextAsync>d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.Cosmos.FeedIteratorCore
1.d__6.MoveNext()--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Test.CosmosIndexDocService.<>c__DisplayClass34_0.
Environment summary
SDK Version:3.15.0
OS Version Windows
.NET Version:4.7.2
The text was updated successfully, but these errors were encountered: