Skip to content

Commit

Permalink
Set max_decoding_message_size to larger value following tonic 0.9.0 (q…
Browse files Browse the repository at this point in the history
  • Loading branch information
agourlay authored and generall committed Apr 11, 2023
1 parent f532ce0 commit 54ecc5d
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions src/tonic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ pub fn init(
let points_service = PointsService::new(dispatcher.toc().clone());
let snapshot_service = SnapshotsService::new(dispatcher.clone());

let max_request_size = settings.service.max_request_size_mb * 1024 * 1024;
log::info!("Qdrant gRPC listening on {}", grpc_port);

let mut server = Server::builder();
Expand All @@ -80,22 +81,26 @@ pub fn init(
.add_service(
QdrantServer::new(qdrant_service)
.send_compressed(CompressionEncoding::Gzip)
.accept_compressed(CompressionEncoding::Gzip),
.accept_compressed(CompressionEncoding::Gzip)
.max_decoding_message_size(max_request_size),
)
.add_service(
CollectionsServer::new(collections_service)
.send_compressed(CompressionEncoding::Gzip)
.accept_compressed(CompressionEncoding::Gzip),
.accept_compressed(CompressionEncoding::Gzip)
.max_decoding_message_size(max_request_size),
)
.add_service(
PointsServer::new(points_service)
.send_compressed(CompressionEncoding::Gzip)
.accept_compressed(CompressionEncoding::Gzip),
.accept_compressed(CompressionEncoding::Gzip)
.max_decoding_message_size(max_request_size),
)
.add_service(
SnapshotsServer::new(snapshot_service)
.send_compressed(CompressionEncoding::Gzip)
.accept_compressed(CompressionEncoding::Gzip),
.accept_compressed(CompressionEncoding::Gzip)
.max_decoding_message_size(max_request_size),
)
.serve_with_shutdown(socket, async {
signal::ctrl_c().await.unwrap();
Expand Down Expand Up @@ -147,22 +152,26 @@ pub fn init_internal(
.add_service(
QdrantServer::new(qdrant_service)
.send_compressed(CompressionEncoding::Gzip)
.accept_compressed(CompressionEncoding::Gzip),
.accept_compressed(CompressionEncoding::Gzip)
.max_decoding_message_size(usize::MAX),
)
.add_service(
CollectionsInternalServer::new(collections_internal_service)
.send_compressed(CompressionEncoding::Gzip)
.accept_compressed(CompressionEncoding::Gzip),
.accept_compressed(CompressionEncoding::Gzip)
.max_decoding_message_size(usize::MAX),
)
.add_service(
PointsInternalServer::new(points_internal_service)
.send_compressed(CompressionEncoding::Gzip)
.accept_compressed(CompressionEncoding::Gzip),
.accept_compressed(CompressionEncoding::Gzip)
.max_decoding_message_size(usize::MAX),
)
.add_service(
RaftServer::new(raft_service)
.send_compressed(CompressionEncoding::Gzip)
.accept_compressed(CompressionEncoding::Gzip),
.accept_compressed(CompressionEncoding::Gzip)
.max_decoding_message_size(usize::MAX),
)
.serve_with_shutdown(socket, async {
signal::ctrl_c().await.unwrap();
Expand Down

0 comments on commit 54ecc5d

Please sign in to comment.