-
Notifications
You must be signed in to change notification settings - Fork 79
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
Up incoming gRPC message limit / allow override #693
Up incoming gRPC message limit / allow override #693
Conversation
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.
Might be worth testing this but this LGTM. Thanks!
client/src/lib.rs
Outdated
self.workflow_svc_client | ||
.get_or_init(|| WorkflowServiceClient::new(self.svc.clone())) | ||
self.workflow_svc_client.get_or_init(|| { | ||
WorkflowServiceClient::new(self.svc.clone()).max_decoding_message_size(*DECODE_MAX_SIZE) |
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.
In Go we also apply this limit to to the sending side as well
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.
Sending side would be limited by server though I believe
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.
I think 4 MB limit on the send side is good enough, that's the default server limit but we can make this configurable as well.
|
||
/// We up the limit on incoming messages from server from the 4Mb default to 128Mb. If for | ||
/// whatever reason this needs to be changed by the user, we support overriding it via env var. | ||
fn get_decode_max_size() -> usize { |
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.
I would prefer if we also supported setting this programmatically but this is good enough.
client/Cargo.toml
Outdated
@@ -31,6 +31,7 @@ tower = "0.4" | |||
tracing = "0.1" | |||
url = "2.2" | |||
uuid = { version = "1.1", features = ["v4"] } | |||
lazy_static = "1.4.0" |
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.
Drive-by comment: lazy-static is more or less deprecated, and people should be using once_cell instead -- which offers a more idiomatic anyway. With newer versions of Rust, you can even rely on OnceLock
from std
directly, although that is a little less ergonomic than once_cell's Lazy
.
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.
No description provided.