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

httpgrpc: Add headers in http grpc error #416

Closed
wants to merge 2 commits into from

Conversation

ying-jeanne
Copy link
Contributor

@ying-jeanne ying-jeanne commented Oct 24, 2023

What this PR does:

In the context of incorporating a retry-after mechanism for all errors that can be recovered, we must compute the retry-after duration within the distributor and include it in the httpgrpc error. This PR focuses on encoding the header within the httpgrpc error, enabling it to be subsequently transmitted to the http response.

Which issue(s) this PR fixes:

Fixes #

Checklist

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

@ying-jeanne ying-jeanne force-pushed the add-header-in-httpgrpc-response branch from cbaa6c6 to aea3890 Compare October 24, 2023 13:37
@ying-jeanne ying-jeanne marked this pull request as ready for review October 24, 2023 13:54
@ying-jeanne ying-jeanne marked this pull request as draft October 24, 2023 13:57
@@ -28,6 +28,14 @@ func Errorf(code int, tmpl string, args ...interface{}) error {
})
}

func ErrorfWithHeaders(code int, headers []*Header, tmpl string, args ...interface{}) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where would this method be called from?
I am currently getting rid of all httpgrpc.Errorf() calls in ingester and distributor. Would like to understand where this new method would be needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

after our conversation, I think this PR is no longer needed. Thanks for the headsup

@ying-jeanne ying-jeanne closed this Nov 2, 2023
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

2 participants