Skip to content

Commit

Permalink
Synchronize with HandleTrace
Browse files Browse the repository at this point in the history
  • Loading branch information
christos68k committed Jan 22, 2025
1 parent d12a80a commit 0009388
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tracehandler/tracehandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ func Start(ctx context.Context, rep reporter.TraceReporter, traceProcessor Trace
for {
select {
case traceUpdate := <-traceInChan:
handler.HandleTrace(traceUpdate)
if traceUpdate != nil {
handler.HandleTrace(traceUpdate)
}
case <-metricsTicker.C:
handler.collectMetrics()
case <-ctx.Done():
Expand Down
3 changes: 3 additions & 0 deletions tracer/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ func (t *Tracer) startTraceEventMonitor(ctx context.Context,
// the current iteration minKTime we'll call
// SymbolizationComplete(t1) first and t0 next, with t0 < t1.
if oldKTime > 0 {
// Ensure that all previously sent trace events have been processed
traceOutChan <- nil

if minKTime > 0 && minKTime <= oldKTime {
// If minKTime is smaller than oldKTime, use it and reset it
// to avoid a repeat during next iteration.
Expand Down

0 comments on commit 0009388

Please sign in to comment.