Skip to content

Commit

Permalink
Increase gRPC message size
Browse files Browse the repository at this point in the history
  • Loading branch information
XAMPPRocky committed Nov 22, 2023
1 parent 87430df commit ea1ea8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/net/xds/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ impl ServiceClient for AdsGrpcClient {
async fn connect(
endpoint: tonic::transport::Endpoint,
) -> Result<Self, tonic::transport::Error> {
AdsGrpcClient::connect(endpoint).await
Ok(AdsGrpcClient::connect(endpoint)
.await?
.max_decoding_message_size(256 * 1024 * 1024)
.max_encoding_message_size(256 * 1024 * 1024))
}

async fn stream_requests<S: tonic::IntoStreamingRequest<Message = Self::Request> + Send>(
Expand All @@ -90,7 +93,10 @@ impl ServiceClient for MdsGrpcClient {
async fn connect(
endpoint: tonic::transport::Endpoint,
) -> Result<Self, tonic::transport::Error> {
MdsGrpcClient::connect(endpoint).await
Ok(MdsGrpcClient::connect(endpoint)
.await?
.max_decoding_message_size(256 * 1024 * 1024)
.max_encoding_message_size(256 * 1024 * 1024))
}

async fn stream_requests<S: tonic::IntoStreamingRequest<Message = Self::Request> + Send>(
Expand Down
6 changes: 4 additions & 2 deletions src/net/xds/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ pub fn spawn(
mode: Admin,
config: std::sync::Arc<crate::Config>,
) -> impl std::future::Future<Output = crate::Result<()>> {
let server = AggregatedDiscoveryServiceServer::new(ControlPlane::from_arc(config, mode));
let server = AggregatedDiscoveryServiceServer::new(ControlPlane::from_arc(config, mode))
.max_encoding_message_size(256 * 1024 * 1024);
let server = tonic::transport::Server::builder().add_service(server);
tracing::info!("serving management server on port `{port}`");
server
Expand All @@ -58,7 +59,8 @@ pub(crate) fn control_plane_discovery_server(
config: Arc<Config>,
) -> impl std::future::Future<Output = crate::Result<()>> {
let server =
AggregatedControlPlaneDiscoveryServiceServer::new(ControlPlane::from_arc(config, mode));
AggregatedControlPlaneDiscoveryServiceServer::new(ControlPlane::from_arc(config, mode))
.max_encoding_message_size(256 * 1024 * 1024);
let server = tonic::transport::Server::builder().add_service(server);
tracing::info!("serving relay server on port `{port}`");
server
Expand Down

0 comments on commit ea1ea8a

Please sign in to comment.