Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/eventqueue: fix concurrent access of waitConsumeOffQueue #10137

Merged
merged 1 commit into from Feb 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/eventqueue/eventqueue.go
Expand Up @@ -144,7 +144,7 @@ type eventStatistics struct {
durationStat spanstat.SpanStat

// waitConsumeOffQueue shows how long it took for the event to be consumed
// off of the queue.
// plus the time it the event waited in the queue.
waitConsumeOffQueue spanstat.SpanStat
}

Expand Down Expand Up @@ -213,9 +213,9 @@ func (q *EventQueue) Enqueue(ev *Event) (<-chan interface{}, error) {
// event is processed, then it will be cancelled.

ev.stats.waitEnqueue.Start()
ev.stats.waitConsumeOffQueue.Start()
q.events <- ev
ev.stats.waitEnqueue.End(true)
ev.stats.waitConsumeOffQueue.Start()
return ev.eventResults, nil
}
}
Expand Down