Repository navigation
feat(bigtable): raise the UDS channel inbound message cap to 256 MB #18782
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
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,16 @@ | |
| _MUTATE_ROW_METHOD = "/google.bigtable.v2.Bigtable/MutateRow" | ||
| _READ_ROWS_METHOD = "/google.bigtable.v2.Bigtable/ReadRows" | ||
|
|
||
| # Inbound message cap on the UDS channel. gRPC defaults this to 4 MiB, a limit | ||
| # meant for a channel that crosses a network. This one doesn't leave the | ||
| # machine: the daemon has already paid the cost of pulling the response off the | ||
| # wire, and all the cap does on this hop is turn an otherwise-fine read into | ||
| # RESOURCE_EXHAUSTED. Raise it well past anything the service itself produces so | ||
| # the UDS leg is never the narrower of the two. | ||
| _MAX_RECEIVE_MESSAGE_LENGTH = 256 * 1024 * 1024 | ||
|
|
||
| _CHANNEL_OPTIONS = (("grpc.max_receive_message_length", _MAX_RECEIVE_MESSAGE_LENGTH),) | ||
|
|
||
|
|
||
| @CrossSync.convert_class(sync_name="_AcceleratorClient") | ||
| class _AsyncAcceleratorClient: | ||
|
|
@@ -59,7 +69,9 @@ class _AsyncAcceleratorClient: | |
| def __init__(self, uds_path: str, auth_secret: str): | ||
| self._uds_path = uds_path | ||
| self._metadata = (("x-accelerator-token", auth_secret),) | ||
| self._channel = insecure_channel(_uds_target(uds_path)) | ||
| self._channel = insecure_channel( | ||
| _uds_target(uds_path), options=_CHANNEL_OPTIONS | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: no test exercises |
||
| ) | ||
| self._mutate_row_stub = self._channel.unary_unary( | ||
| _MUTATE_ROW_METHOD, | ||
| request_serializer=MutateRowRequest.serialize, | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two concerns with the one-sided cap:
1. Send-side left at the gRPC 4 MiB default — silent regression vs. the native path. The native google-cloud-bigtable Python client sets both
grpc.max_send_message_lengthandgrpc.max_receive_message_lengthto-1(unlimited). This PR raises only inbound, so anApplyBulk/MutateRowwith a payload >4 MiB (allowed by the server's 100 MiB per-cell limit) will fail at the accelerator channel's outbound serialization check with no analogous server-side error. On the native path the same call goes through. Suggest raising send too:2. Pick a side on the 256 MB number. Native uses
-1(unlimited). 256 MB from thin air invites "why not 128? why not 1 GiB?" and future drift when the native client bumps. Either match native (-1, both directions) and document "match native" in the comment, or if 256 MB is a deliberate memory-safety choice at the UDS hop, say that explicitly.