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

Distributor: improve extracting status code from ingester.Push() errors #6598

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

duricanikolic
Copy link
Contributor

What this PR does

This simple PR improves error status code extraction in distributor.handleIngesterPushError().
In the previous implementation, we were checking:

  • if error can be recognized by httpgrpc.HTTPResponseFromError() (which internally calls status.FromError()), and if not
  • if error can be recognized by status.FromError().

Hence, in some cases we were indirectly calling status.FromError() twice. This can be optimized by calling dskit's grpcutil.StatusFromError() only once.

Which issue(s) this PR fixes or relates to

Part of #6008

Checklist

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

Signed-off-by: Yuri Nikolic <durica.nikolic@grafana.com>
@duricanikolic duricanikolic self-assigned this Nov 8, 2023
@duricanikolic duricanikolic requested a review from a team as a code owner November 8, 2023 10:03
Copy link
Member

@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, thanks.

@duricanikolic duricanikolic merged commit dbc941a into main Nov 8, 2023
28 checks passed
@duricanikolic duricanikolic deleted the yuri/handling-errors-new branch November 8, 2023 13:56
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.

2 participants