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 422 (instead 500) when query hit max_chunks_per_query limit with block storage #3895

Merged

Conversation

alanprot
Copy link
Member

@alanprot alanprot commented Mar 2, 2021

Hi, i think we should return 422 instead of 500 when a query hits the max_chunks_per_query limits

What this PR does:
Return 422 instead of 500 when a query hits the max_chunks_per_query limits

Same type of error is used here with max_query_length limit and this error is translated to 422 as explained here

Which issue(s) this PR fixes:
Fixes #

Checklist

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

@alanprot alanprot changed the title Returning 429 (instead 500) when query hit max_chunks_per_query limit Returning 429 (instead 500) when query hit max_chunks_per_query limit on block storage Mar 2, 2021
@alanprot alanprot changed the title Returning 429 (instead 500) when query hit max_chunks_per_query limit on block storage Returning 429 (instead 500) when query hit max_chunks_per_query limit when using block storage Mar 2, 2021
@alanprot alanprot force-pushed the enhancement/422-on-query-max-chunks branch from 916cbc9 to 196acfd Compare March 2, 2021 09:23
@alanprot alanprot changed the title Returning 429 (instead 500) when query hit max_chunks_per_query limit when using block storage Returning 422 (instead 500) when query hit max_chunks_per_query limit when using block storage Mar 2, 2021
@alanprot alanprot force-pushed the enhancement/422-on-query-max-chunks branch from 196acfd to 19d0f54 Compare March 2, 2021 09:24
@alanprot alanprot changed the title Returning 422 (instead 500) when query hit max_chunks_per_query limit when using block storage Returning 422 (instead 500) when query hit max_chunks_per_query limit with using block storage Mar 2, 2021
@alanprot alanprot changed the title Returning 422 (instead 500) when query hit max_chunks_per_query limit with using block storage Returning 422 (instead 500) when query hit max_chunks_per_query limit with block storage Mar 2, 2021
@alanprot alanprot force-pushed the enhancement/422-on-query-max-chunks branch from 19d0f54 to bb1d2b0 Compare March 2, 2021 09:35
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@alanprot alanprot force-pushed the enhancement/422-on-query-max-chunks branch from a0efef3 to bb1d2b0 Compare March 2, 2021 16:58
Co-authored-by: Peter Štibraný <[email protected]>
Signed-off-by: Alan Protasio <[email protected]>
@alanprot alanprot force-pushed the enhancement/422-on-query-max-chunks branch from 3d28c60 to 58e6c8a Compare March 2, 2021 17:00
@alanprot
Copy link
Member Author

alanprot commented Mar 2, 2021

Thanks @pstibrany

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.

LGTM, thanks! 👏

Signed-off-by: Marco Pracucci <[email protected]>
@pstibrany pstibrany merged commit e02797a into cortexproject:master Mar 2, 2021
pracucci pushed a commit that referenced this pull request Apr 8, 2021
…`max_chunks_per_query` limit with block storage (#3937)

* Updating thanos

Signed-off-by: Alan Protasio <[email protected]>

* Returning 422 when chunk limits are reached

Signed-off-by: Alan Protasio <[email protected]>

* Addresing PR comments

Signed-off-by: Alan Protasio <[email protected]>

* Updating Changelog

Signed-off-by: Alan Protasio <[email protected]>
roystchiang pushed a commit to roystchiang/cortex that referenced this pull request Apr 6, 2022
… with block storage (cortexproject#3895)

* Returning 422 (instead 500) when query hit max_chunks_per_query limit

Signed-off-by: Alan Protasio <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Peter Štibraný <[email protected]>
Signed-off-by: Alan Protasio <[email protected]>

* Update CHANGELOG.md

Signed-off-by: Marco Pracucci <[email protected]>

Co-authored-by: Peter Štibraný <[email protected]>
Co-authored-by: Marco Pracucci <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants