Skip to content

Commit

Permalink
gRPC Server allow drop of request trailers (#1341)
Browse files Browse the repository at this point in the history
Motivation:
The
[gRPC protocol](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests)
does not use request trailers. This means the server is allowed to drop
trailers if any are present. This may provide a performance benefit as
request transformation operations do not have to worry about preserving
trailers.

Modifications:
- DefaultGrpcServerBuilder to use the allowDropRequestTrailers(true)
  method.

Result:
gRPC Server is allowed to drop the request trailers, requiring less work
to preserve trailers (which don't exist) through request transform
operations.
  • Loading branch information
Scottmitch authored Feb 1, 2021
1 parent 2edcee2 commit ba50beb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ final class DefaultGrpcServerBuilder extends GrpcServerBuilder implements Server
.executionStrategy(defaultStrategy());

DefaultGrpcServerBuilder(final HttpServerBuilder httpServerBuilder) {
this.httpServerBuilder = httpServerBuilder.protocols(h2Default());
this.httpServerBuilder = httpServerBuilder.protocols(h2Default()).allowDropRequestTrailers(true);
}

@Override
Expand Down

0 comments on commit ba50beb

Please sign in to comment.