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

Returning custom grpc code when reaching series/chunk limits #3903

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

alanprot
Copy link
Contributor

@alanprot alanprot commented Mar 10, 2021

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

This change allow to return a different/custom GRPC code - other than the generic Aborted - when the limits are hit via SeriesLimiter or ChunksLimiter.

The reason for this change is that it is hard for the caller to differentiate when the error returned by Series method was generated by a limiter or if it was a generic/transient error. Propagating the error code generated by the limiter will create the possibility to return any GRPC code on those cases.

  • If the error generated by the SeriesLimiter and ChunksLimiter is a GRPC error, the Series will return a GRPC error with the same errorcode.

Verification

  • Unit tests

@alanprot alanprot changed the title Returning custom grpc code when series/chunk limits are reached Returning custom grpc code when reaching series/chunk limits Mar 10, 2021
@alanprot alanprot force-pushed the feature/limits-err-code branch from 9d32ef7 to f7c84bc Compare March 10, 2021 04:42
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

I'm 👍 with the change but I'm not sure the unit test makes much sense from the Thanos perspective. This change originates from a need we have in Cortex and the test is trying to mimick it, but from Thanos perspective how we're going to use it is irrelevant. Because of this I'm wondering if we should keep the change but revert the unit test changes.

@alanprot
Copy link
Contributor Author

alanprot commented Mar 10, 2021

Hi @pracucci, Thanks for your reply.

I can remove the tests but i think if we are coding a behaviour here we should also test it here to make sure it does not change right?

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

I think I like it and the test makes sense too - it makes sure we preserve the error handling. Let's do this 💪🏽 Thanks! LGTM

@bwplotka bwplotka merged commit 3b7aa3b into thanos-io:main Mar 10, 2021
andrejbranch pushed a commit to andrejbranch/thanos that referenced this pull request Mar 11, 2021
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.

3 participants