diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-09-28 11:01:08 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2023-10-04 11:31:25 +0300 |
commit | 2d170550f1887c7787fa72d01eebd71655d593ca (patch) | |
tree | 4dc9e9de6c449589438b75e95314778735f5840c /internal/praefect | |
parent | 1fbdff1e93a3b7234e0f04b3101c7a5358c9c804 (diff) |
middleware: Rename metadatahandler to requestinfohandler
We have two different mechanisms to inject information about the current
gRPC call into the context:
- The metadatahandler injects data about the metadata, e.g. the peer
information and whether a call is an accessor or a mutator.
- The field extractor that gets set up via go-grpc-middleware's tags
interceptor and that injects data about the request.
The tagging mechanism used by the field extractor is going away in the
go-grpc-middleware dependency though without replacement. Furthermore,
both functionalities are related to each other and can thus easily share
the same infrastructure. We are thus about to merge them.
As a first step, let's rename the metadatahandler to requestinfohandler
such that it better reflects the new reponsibility when it will start to
handle both gRPC call metadata and request information.
Diffstat (limited to 'internal/praefect')
-rw-r--r-- | internal/praefect/server.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/praefect/server.go b/internal/praefect/server.go index 066f2bf78..4044e8eab 100644 --- a/internal/praefect/server.go +++ b/internal/praefect/server.go @@ -14,8 +14,8 @@ import ( "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/backchannel" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/grpcstats" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/listenmux" - "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/middleware/metadatahandler" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/middleware/panichandler" + "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/middleware/requestinfohandler" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/middleware/sentryhandler" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/middleware/statushandler" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/proxy" @@ -69,7 +69,7 @@ func commonUnaryServerInterceptors(logger log.Logger, messageProducer grpcmwlogr return []grpc.UnaryServerInterceptor{ grpcmwtags.UnaryServerInterceptor(ctxtagsInterceptorOption()), grpccorrelation.UnaryServerCorrelationInterceptor(), // Must be above the metadata handler - metadatahandler.UnaryInterceptor, + requestinfohandler.UnaryInterceptor, grpcprometheus.UnaryServerInterceptor, logger.UnaryServerInterceptor( grpcmwlogrus.WithTimestampFormat(log.LogTimestampFormat), @@ -139,7 +139,7 @@ func NewGRPCServer( grpcmwtags.StreamServerInterceptor(ctxtagsInterceptorOption()), grpccorrelation.StreamServerCorrelationInterceptor(), // Must be above the metadata handler middleware.MethodTypeStreamInterceptor(deps.Registry, deps.Logger), - metadatahandler.StreamInterceptor, + requestinfohandler.StreamInterceptor, grpcprometheus.StreamServerInterceptor, deps.Logger.WithField("component", "praefect.StreamServerInterceptor").StreamServerInterceptor( grpcmwlogrus.WithTimestampFormat(log.LogTimestampFormat), |