Skip to content

feat(channel): expose message-size and keepalive options#104

Merged
zeevdr merged 1 commit into
mainfrom
feat/channel-message-size-options
May 25, 2026
Merged

feat(channel): expose message-size and keepalive options#104
zeevdr merged 1 commit into
mainfrom
feat/channel-message-size-options

Conversation

@zeevdr
Copy link
Copy Markdown
Member

@zeevdr zeevdr commented May 25, 2026

Summary

  • gRPC's 4 MB default message size limit can silently truncate large JSON config values; callers had no way to raise it without forking the channel factory.
  • max_send_message_length and max_recv_message_length are now optional kwargs on both create_channel and create_aio_channel; omitting them preserves the existing behaviour.
  • Keepalive and reconnect-backoff constants are also surfaced as kwargs so callers can tune them without internal changes.

Test plan

  • test_message_size_options_included_when_set — verifies options appear in channel call when values are provided
  • test_message_size_options_absent_by_default — verifies options are absent when not provided
  • test_keepalive_override — verifies non-default keepalive values propagate correctly
  • All existing channel tests pass unchanged (246 passed, 97.5% coverage)

Closes #67

Add optional max_send_message_length and max_recv_message_length
parameters to create_channel and create_aio_channel. When set,
the corresponding grpc.max_send_message_length /
grpc.max_receive_message_length options are appended; when omitted
the gRPC default (4 MB) applies unchanged.

Keepalive tuning constants (time, timeout, permit_without_calls,
reconnect backoffs) are also promoted from hard-coded internals to
keyword arguments with the same defaults, so callers can tune them
without forking the factory.

Closes #67

Co-Authored-By: Claude <noreply@anthropic.com>
@zeevdr zeevdr added this to the Beta Readiness milestone May 25, 2026
@zeevdr zeevdr added size: S Quick win — a few hours or less priority: P2 Nice-to-have labels May 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@zeevdr zeevdr merged commit 7f877d1 into main May 25, 2026
15 checks passed
@zeevdr zeevdr deleted the feat/channel-message-size-options branch May 25, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: P2 Nice-to-have size: S Quick win — a few hours or less

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Channel: surface max_send/recv_message_length and keepalive options

1 participant