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

[Cosmos DB] Handle cases where desired worker count exceeds int.MaxInt #873

Merged
merged 7 commits into from
Oct 31, 2023

Conversation


try
{
targetWorkerCount = (int)Math.Ceiling(remainingWork / (decimal)concurrency);
Copy link
Member

@paulbatum paulbatum Oct 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest wrapping in a checked block - doing so makes sure that this operation will always throw an overflow exception regardless of the project level settings

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/statements/checked-and-unchecked

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, updated all other SDK PRs to match this implementation

@pragnagopa pragnagopa requested a review from alrod October 26, 2023 16:59
@ealsur ealsur merged commit a979d6b into dev Oct 31, 2023
7 checks passed
@ealsur ealsur deleted the user/vchiang/fixoverflow branch October 31, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants