summaryrefslogtreecommitdiff
path: root/vendor/github.com/uber/jaeger-client-go/reporter.go
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2019-09-30 12:40:36 +0000
committerValentin Rothberg <rothberg@redhat.com>2019-09-30 15:04:52 +0200
commit2f397ecdeb1f5f064e30c3ab9bf85f5c10c41afa (patch)
treea31c7db2b6c0d06975854212dac61de13f39807f /vendor/github.com/uber/jaeger-client-go/reporter.go
parent01b7af8ee9b3df1439c4da109ba11e7410108dab (diff)
downloadpodman-2f397ecdeb1f5f064e30c3ab9bf85f5c10c41afa.tar.gz
podman-2f397ecdeb1f5f064e30c3ab9bf85f5c10c41afa.tar.bz2
podman-2f397ecdeb1f5f064e30c3ab9bf85f5c10c41afa.zip
Bump github.com/uber/jaeger-client-go
Bumps [github.com/uber/jaeger-client-go](https://github.com/uber/jaeger-client-go) from 2.16.0+incompatible to 2.19.0+incompatible. - [Release notes](https://github.com/uber/jaeger-client-go/releases) - [Changelog](https://github.com/jaegertracing/jaeger-client-go/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber/jaeger-client-go/compare/v2.16.0...v2.19.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/uber/jaeger-client-go/reporter.go')
-rw-r--r--vendor/github.com/uber/jaeger-client-go/reporter.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/vendor/github.com/uber/jaeger-client-go/reporter.go b/vendor/github.com/uber/jaeger-client-go/reporter.go
index fe6288c4b..27163ebe4 100644
--- a/vendor/github.com/uber/jaeger-client-go/reporter.go
+++ b/vendor/github.com/uber/jaeger-client-go/reporter.go
@@ -93,13 +93,14 @@ func NewInMemoryReporter() *InMemoryReporter {
// Report implements Report() method of Reporter by storing the span in the buffer.
func (r *InMemoryReporter) Report(span *Span) {
r.lock.Lock()
- r.spans = append(r.spans, span)
+ // Need to retain the span otherwise it will be released
+ r.spans = append(r.spans, span.Retain())
r.lock.Unlock()
}
-// Close implements Close() method of Reporter by doing nothing.
+// Close implements Close() method of Reporter
func (r *InMemoryReporter) Close() {
- // no-op
+ r.Reset()
}
// SpansSubmitted returns the number of spans accumulated in the buffer.
@@ -122,7 +123,12 @@ func (r *InMemoryReporter) GetSpans() []opentracing.Span {
func (r *InMemoryReporter) Reset() {
r.lock.Lock()
defer r.lock.Unlock()
- r.spans = nil
+
+ // Before reset the collection need to release Span memory
+ for _, span := range r.spans {
+ span.(*Span).Release()
+ }
+ r.spans = r.spans[:0]
}
// ------------------------------
@@ -218,7 +224,8 @@ func NewRemoteReporter(sender Transport, opts ...ReporterOption) Reporter {
// because some of them may still be successfully added to the queue.
func (r *remoteReporter) Report(span *Span) {
select {
- case r.queue <- reporterQueueItem{itemType: reporterQueueItemSpan, span: span}:
+ // Need to retain the span otherwise it will be released
+ case r.queue <- reporterQueueItem{itemType: reporterQueueItemSpan, span: span.Retain()}:
atomic.AddInt64(&r.queueLength, 1)
default:
r.metrics.ReporterDropped.Inc(1)
@@ -278,6 +285,7 @@ func (r *remoteReporter) processQueue() {
// to reduce the number of gauge stats, we only emit queue length on flush
r.metrics.ReporterQueueLength.Update(atomic.LoadInt64(&r.queueLength))
}
+ span.Release()
case reporterQueueItemClose:
timer.Stop()
flush()