-
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: Fixes IndexOutOfRangeException #2099
Conversation
@@ -40,6 +40,7 @@ public async Task TestInitialize() | |||
this.containerSettings = new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPath: PartitionKey); | |||
ContainerResponse response = await this.database.CreateContainerAsync( | |||
this.containerSettings, | |||
throughput: 20000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this change make any difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes it where there is multiple logical partitions which should cause the race condition to be exposed during our testing runs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it impact the test durations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was no noticeable difference when testing locally or in gates. It still drains the same number of items. Worst case is for some queries it might result in a extra read operation.
Pull Request Template
Description
To avoid any IndexOutOfRangeException the CosmosDiagnostics is refactored to remove the AddRange call. This will avoid any indexing issues caused by the possibility of the CosmosDiagnosticsContext getting modified in another task at the same time it is getting append to a parent CosmosDiagnosticContext.
This should also help improve performance by reducing the number of copies required when combining multiple CosmosDiangosticsContext.
Type of change
Please delete options that are not relevant.
Closing issues
To automatically close an issue: closes #2075