From f4525056e7bc1803f8e72fb57b966678b9bd7ac3 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 20 Apr 2020 10:33:28 -0700 Subject: [PATCH] nuke sendAfterIdleTimeout --- collect/collect.go | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/collect/collect.go b/collect/collect.go index c7fbbb03b5..bfe3ad87ce 100644 --- a/collect/collect.go +++ b/collect/collect.go @@ -362,30 +362,6 @@ func (i *InMemCollector) sendAfterTraceTimeout(trace *types.Trace) { go i.pauseAndSend(dur, trace) } -// if the configuration says "send the trace when no new spans have come in for -// X seconds" this function will cancel all outstanding send timers and start a -// new one. To prevent infinitely postponed traces, there is still the (TODO) -// total number of spans cap and a (TODO) gloabal time since first seen cap. -// -// TODO this is not yet actually implemented, but leaving the function here as a -// reminder that it'd be an interesting config to add. -func (i *InMemCollector) sendAfterIdleTimeout(trace *types.Trace) { - // cancel all outstanding sending timers - close(trace.CancelSending) - - // get the configured delay - spanSeenDelay, err := i.Config.GetSpanSeenDelay() - if err != nil { - i.Logger.Errorf("failed to get send delay. pausing for 2 seconds") - spanSeenDelay = 2 - } - - // make a new cancel sending channel and then wait on it - trace.CancelSending = make(chan struct{}) - dur := time.Duration(spanSeenDelay) * time.Second - go i.pauseAndSend(dur, trace) -} - // sendAfterRootDelay waits the SendDelay timeout then registers the trace to be // sent. func (i *InMemCollector) sendAfterRootDelay(trace *types.Trace) {