Fix gRPC timeout precision and metadata interoperability - #17
Merged
Merged
Conversation
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Timeout serialization currently turns 90 seconds into
1M, binary metadata rejects valid unpadded base64, and error responses disclose server backtraces by default. Preserve timeout precision (rounding upward within the eight-digit limit), accept padded/unpadded metadata while retaining strict validation, and requirebacktrace: trueto serialize backtraces.Binary metadata decoding accepts the standard Base64 alphabet with either correct padding or no padding. Partial padding, URL-safe characters, whitespace, and invalid pad bits are rejected. Only unpadded values that need padding allocate a padded input copy.
Also default request metadata to
application/grpcand add the HTTP-to-gRPC fallback status mapping needed by the dependent client fixes. Existing explicit codec content types remain supported.Fixes #14.
Fixes #15.
Fixes #16.
Related: socketry/async-grpc-compatible#2, socketry/async-grpc-compatible#3, socketry/async-grpc-compatible#4.
Issue #14's body currently describes GAPIC integration instead of timeouts; the timeout fix follows its title and the reproduced serialization behavior.
Validation:
COVERAGE=PartialSummary bundle exec bake test(227 tests, 451 assertions; 100% line coverage),bundle exec rubocop, andbundle exec bake decode:index:coverage lib(103/103 public definitions). Tested locally on Ruby 4.0.7, including the dependent async-grpc and compatibility worktrees. The backtrace default change is documented under Unreleased.Dependent client PRs: socketry/async-grpc#10 and socketry/async-grpc-compatible#7. Those drafts require this change to be merged and released before their dependency minimums can be finalized.