Skip to content

Commit

Permalink
Fix Yuri's comments
Browse files Browse the repository at this point in the history
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
  • Loading branch information
pavolloffay committed Aug 20, 2020
1 parent 12166c0 commit 5b95e48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion cmd/agent/app/reporter/client_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,11 @@ func (r *ClientMetricsReporter) EmitBatch(ctx context.Context, batch *jaeger.Bat
}

// Close stops background gc goroutine for client stats map.
func (r *ClientMetricsReporter) Close() {
func (r *ClientMetricsReporter) Close() error {
if r.closed.CAS(false, true) {
close(r.shutdown)
}
return nil
}

func (r *ClientMetricsReporter) expireClientMetricsLoop() {
Expand Down
5 changes: 2 additions & 3 deletions cmd/agent/app/reporter/grpc/collector_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/jaegertracing/jaeger/cmd/agent/app/configmanager"
grpcManager "github.com/jaegertracing/jaeger/cmd/agent/app/configmanager/grpc"
"github.com/jaegertracing/jaeger/cmd/agent/app/reporter"
"github.com/jaegertracing/jaeger/pkg/multicloser"
)

// ProxyBuilder holds objects communicating with collector
Expand Down Expand Up @@ -73,7 +74,5 @@ func (b ProxyBuilder) GetManager() configmanager.ClientConfigManager {

// Close closes connections used by proxy.
func (b ProxyBuilder) Close() error {
b.reporter.Close()
b.tlsCloser.Close()
return b.conn.Close()
return multicloser.Wrap(b.reporter, b.tlsCloser, b.GetConn()).Close()
}

0 comments on commit 5b95e48

Please sign in to comment.