From 735808bd5b97c3665d07c2ea77c1d5e69a8d64cd Mon Sep 17 00:00:00 2001 From: Andrew Gouin Date: Wed, 10 Jul 2024 14:42:00 -0600 Subject: [PATCH] fix(runtime): debug server not starting due to blocking grpc serve (#275) * fix(runtime): debug server not starting due to blocking grpc serve * Update signer/remote_signer_grpc_server.go --- signer/remote_signer_grpc_server.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/signer/remote_signer_grpc_server.go b/signer/remote_signer_grpc_server.go index 59c116da..797735ad 100644 --- a/signer/remote_signer_grpc_server.go +++ b/signer/remote_signer_grpc_server.go @@ -2,6 +2,7 @@ package signer import ( "context" + "fmt" "net" "time" @@ -50,7 +51,14 @@ func (s *RemoteSignerGRPCServer) OnStart() error { s.server = grpc.NewServer() proto.RegisterRemoteSignerServer(s.server, s) reflection.Register(s.server) - return s.server.Serve(sock) + go s.serve(sock) + return nil +} + +func (s *RemoteSignerGRPCServer) serve(sock net.Listener) { + if err := s.server.Serve(sock); err != nil { + panic(fmt.Errorf("remote signer grpc server: %w", err)) + } } func (s *RemoteSignerGRPCServer) OnStop() {