fn: avoid go-routine leak (#934)

This commit is contained in:
Tolga Ceylan
2018-04-11 12:11:08 -07:00
committed by GitHub
parent b5a732ff1b
commit 9b86e3626e

View File

@@ -40,7 +40,7 @@ func SecureGRPCRunnerFactory(addr, runnerCertCN string, pki *pool.PKIData) (pool
// Close waits until the context is closed for all inflight requests // Close waits until the context is closed for all inflight requests
// to complete prior to terminating the underlying grpc connection // to complete prior to terminating the underlying grpc connection
func (r *gRPCRunner) Close(ctx context.Context) error { func (r *gRPCRunner) Close(ctx context.Context) error {
err := make(chan error) err := make(chan error, 1)
go func() { go func() {
defer close(err) defer close(err)
r.wg.Wait() r.wg.Wait()