Skip to content

Add retry-after header for gRPC#6072

Merged
agourlay merged 6 commits intodevfrom
retry-after-header-grpc
Feb 28, 2025
Merged

Add retry-after header for gRPC#6072
agourlay merged 6 commits intodevfrom
retry-after-header-grpc

Conversation

@agourlay
Copy link
Member

@agourlay agourlay commented Feb 26, 2025

Follow up to #5917 for the gRPC API.

The retry-after header is passed using the standard gRPC metadata structure.

The value can easily be extracted my clients. (e.g. Rust client)

This PR makes sure that the retry-after header is properly propagated during inter node communication.

There is a test to validate the end to end error propagation when querying an empty node.

@agourlay agourlay force-pushed the retry-after-header-grpc branch from e4055bf to f550fa6 Compare February 27, 2025 10:13
@agourlay agourlay marked this pull request as ready for review February 27, 2025 15:28
} = retry_error;
let description = format!(
"{rate_limiter_type} rate limit exceeded: Operation requires {cost} tokens but only {tokens_available} were available. Retry after {}s",
"{rate_limiter_type} rate limit exceeded: Operation requires {cost} tokens but only {tokens_available:.1} were available. Retry after {}s",
Copy link
Member Author

Choose a reason for hiding this comment

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

no need to display more than one digit precision

@agourlay agourlay requested a review from timvisee February 27, 2025 16:10
Co-authored-by: Tim Visée <tim+github@visee.me>
@agourlay agourlay merged commit fc17b79 into dev Feb 28, 2025
17 checks passed
@agourlay agourlay deleted the retry-after-header-grpc branch February 28, 2025 10:41
timvisee added a commit that referenced this pull request Mar 21, 2025
* Add retry-after header for gRPC

* propagate retry-after within inter node communication

* snipe

* tweak and test

* log all parsing errors

* Update lib/collection/src/operations/types.rs

Co-authored-by: Tim Visée <tim+github@visee.me>

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
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