github.com/hashicorp/go-plugin@v1.6.0/grpc_controller.go (about) 1 // Copyright (c) HashiCorp, Inc. 2 // SPDX-License-Identifier: MPL-2.0 3 4 package plugin 5 6 import ( 7 "context" 8 9 "github.com/hashicorp/go-plugin/internal/plugin" 10 ) 11 12 // GRPCControllerServer handles shutdown calls to terminate the server when the 13 // plugin client is closed. 14 type grpcControllerServer struct { 15 server *GRPCServer 16 } 17 18 // Shutdown stops the grpc server. It first will attempt a graceful stop, then a 19 // full stop on the server. 20 func (s *grpcControllerServer) Shutdown(ctx context.Context, _ *plugin.Empty) (*plugin.Empty, error) { 21 resp := &plugin.Empty{} 22 23 // TODO: figure out why GracefullStop doesn't work. 24 s.server.Stop() 25 return resp, nil 26 }