rpc: fix missing logger context vars in control connection handlers

use ctxInterceptor in gRPC interceptors
also panic if the unimplemented stream interceptor is used
This commit is contained in:
Christian Schwarz
2019-12-22 16:31:33 +01:00
parent 6ebd9f1037
commit 5b52e5e331
4 changed files with 14 additions and 6 deletions

View File

@ -35,9 +35,10 @@ type HandlerContextInterceptor func(ctx context.Context) context.Context
// config must be valid (use its Validate function).
func NewServer(handler Handler, loggers Loggers, ctxInterceptor HandlerContextInterceptor) *Server {
// setup control server
controlServerServe := func(ctx context.Context, controlListener transport.AuthenticatedListener, errOut chan<- error) {
controlServer, serve := grpchelper.NewServer(controlListener, endpoint.ClientIdentityKey, loggers.Control)
controlServer, serve := grpchelper.NewServer(controlListener, endpoint.ClientIdentityKey, loggers.Control, ctxInterceptor)
pdu.RegisterReplicationServer(controlServer, handler)
// give time for graceful stop until deadline expires, then hard stop