Skip to content

Add TELEPORT_UNSTABLE_GRPC_RECV_SIZE env var option#57846

Merged
okraport merged 1 commit intomasterfrom
okraport/grpc-msg-size-overwrite
Aug 19, 2025
Merged

Add TELEPORT_UNSTABLE_GRPC_RECV_SIZE env var option#57846
okraport merged 1 commit intomasterfrom
okraport/grpc-msg-size-overwrite

Conversation

@okraport
Copy link
Copy Markdown
Contributor

Setting this env var allows overwriting the max
size of a grpc message the client can receive (default is 4MB).

Towards: https://github.com/gravitational/teleport.e/issues/6759
changelog: Add TELEPORT_UNSTABLE_GRPC_RECV_SIZE env var which can be set to overwrite client side max grpc message size.

@okraport
Copy link
Copy Markdown
Contributor Author

Can reproduce the failure by setting the size to be too small intentionally:

% TELEPORT_UNSTABLE_GRPC_RECV_SIZE=4000 ./build/tctl get all
ERROR: grpc: received message larger than max (8715 vs. 4000)

@okraport okraport force-pushed the okraport/grpc-msg-size-overwrite branch from c30b76d to a00f408 Compare August 13, 2025 12:05
@okraport okraport marked this pull request as ready for review August 13, 2025 12:25
@okraport okraport requested a review from rosstimothy August 13, 2025 12:30
Comment thread api/client/proxy/client.go Outdated
Comment thread api/client/client.go Outdated
Comment thread api/utils/grpc/size.go Outdated
Comment thread api/utils/grpc/size.go
Comment on lines +29 to +32
// parseBytes takes human represtation of bytes such as '24mb' and returns number of bytes as an integer
//
// Only support a subset of SI prefixes up to gi/gb.
func parseBytes(s string) (int, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is nice, but might be more complicated than we need. What do you think about requiring the value to always be specified in bytes? Would that UX be too suboptimal?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

My thinking here was that the minimum being 4mib any client side error will want to set that value much higher and personally I prefer the readable variant:

TELEPORT_UNSTABLE_GRPC_RECV_SIZE=16mib tctl get all
# vs
TELEPORT_UNSTABLE_GRPC_RECV_SIZE=16777216 tctl get all

That being said if we are doing this it's already a workaround I'm happy to remove it if it's too overkill!

Comment thread api/utils/grpc/size.go
@okraport okraport requested a review from tigrato August 19, 2025 09:33
Setting this env var allows overwriting the max
size of a grpc message the client can recieve (default is 4MB).

Towards: gravitational/teleport.e#6759
changelog: Add TELEPORT_UNSTABLE_GRPC_RECV_SIZE env var which can be set to overwrite client side max grpc message size.
@okraport okraport force-pushed the okraport/grpc-msg-size-overwrite branch from 07c804c to 4550102 Compare August 19, 2025 09:50
@okraport okraport enabled auto-merge August 19, 2025 09:52
@okraport okraport added this pull request to the merge queue Aug 19, 2025
Merged via the queue into master with commit b4b9e97 Aug 19, 2025
41 checks passed
@okraport okraport deleted the okraport/grpc-msg-size-overwrite branch August 19, 2025 10:34
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@okraport See the table below for backport results.

Branch Result
branch/v16 Create PR
branch/v17 Create PR
branch/v18 Create PR

ryanclark pushed a commit that referenced this pull request Aug 19, 2025
Setting this env var allows overwriting the max
size of a grpc message the client can recieve (default is 4MB).

Towards: gravitational/teleport.e#6759
changelog: Add TELEPORT_UNSTABLE_GRPC_RECV_SIZE env var which can be set to overwrite client side max grpc message size.
ryanclark pushed a commit that referenced this pull request Aug 19, 2025
Setting this env var allows overwriting the max
size of a grpc message the client can recieve (default is 4MB).

Towards: gravitational/teleport.e#6759
changelog: Add TELEPORT_UNSTABLE_GRPC_RECV_SIZE env var which can be set to overwrite client side max grpc message size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants