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

Request Charge: Fixes request charges for offers and CreateIfNotExists APIs #2041

Merged
merged 8 commits into from
Dec 4, 2020

Conversation

j82w
Copy link
Contributor

@j82w j82w commented Dec 2, 2020

Pull Request Template

Description

This fixes bugs where the operation requires multiple requests to the service to complete one user request. This fixes offers, CreateDatabaseIfNotExists and CreateContainerIfNotExists. Tests are added to prevent future regressions.

Added a additional check to the TransportHandler which verifies that does a warning trace if RequestChargeTracker is greater than the response. RequestChargeTracker is not used for gateway calls.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] This change requires a documentation update

Closing issues

To automatically close an issue: closes #IssueNumber

@j82w j82w added the bug Something isn't working label Dec 2, 2020
@j82w j82w self-assigned this Dec 2, 2020
ealsur
ealsur previously approved these changes Dec 2, 2020
Copy link
Member

@ealsur ealsur left a comment

Choose a reason for hiding this comment

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

Would it make sense to add a UT on the containerCore/DatabaseCore that mocks the ClientContext and simulates scenarios like the Conflict path, and ensures the resulting RU charge is always the sum of all the mocked responses?

@j82w
Copy link
Contributor Author

j82w commented Dec 2, 2020

Would it make sense to add a UT on the containerCore/DatabaseCore that mocks the ClientContext and simulates scenarios like the Conflict path, and ensures the resulting RU charge is always the sum of all the mocked responses?

This could also be done using the request handler to inject the 409.

@j82w
Copy link
Contributor Author

j82w commented Dec 3, 2020

Would it make sense to add a UT on the containerCore/DatabaseCore that mocks the ClientContext and simulates scenarios like the Conflict path, and ensures the resulting RU charge is always the sum of all the mocked responses?

I added this via the handler logic in the latest iteration.

Copy link
Member

@FabianMeiswinkel FabianMeiswinkel left a comment

Choose a reason for hiding this comment

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

LGTM

@j82w j82w merged commit bfb3d8f into master Dec 4, 2020
@j82w j82w deleted the users/jawilley/bug/ru branch December 4, 2020 17:34
@ghost
Copy link

ghost commented Dec 15, 2021

Closing due to in-activity, pease feel free to re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants