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

Fix returned status code on max samples limit hit when query sharding is enabled #499

Merged
merged 1 commit into from
Nov 16, 2021

Conversation

pracucci
Copy link
Collaborator

What this PR does:
While running some tests in a cluster with query sharding enabled, I've noticed that when the "max samples limit" is reached the returned status code is 5xx instead of 422 (as done by Prometheus). The API errors mapping was fixed in #360 but we forgot to handle the promql.ErrTooManySamples so this PR fixes that case.

Which issue(s) this PR fixes:
N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

… is enabled

Signed-off-by: Marco Pracucci <marco@pracucci.com>
Copy link
Contributor

@replay replay left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -823,12 +823,6 @@ func TestQuerySharding_ShouldReturnErrorInCorrectFormat(t *testing.T) {
expError: apierror.New(apierror.TypeTimeout, "query timed out in expression evaluation"),
queryable: queryableSlow,
},
{
name: "downstream - sample limit",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed because was a duplicate.

@pracucci pracucci merged commit c0cf908 into main Nov 16, 2021
@pracucci pracucci deleted the fix-status-code-if-max-samples-limit-is-hit branch November 16, 2021 13:45
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.

None yet

3 participants