Skip to content

Commit

Permalink
Fix bug where we marked successfully received messages as lost
Browse files Browse the repository at this point in the history
  • Loading branch information
weeco committed Aug 11, 2021
1 parent 634347d commit 5e11446
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions e2e/message_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ func (t *messageTracker) onMessageArrived(arrivedMessage *EndToEndMessage) {
}

func (t *messageTracker) onMessageExpired(_ string, msg *EndToEndMessage) {
// Because `t.cache.Delete` will invoke the onEvicted method we have to expect some calls to this function
// even though messages have arrived. Thus, we quit early if we receive such a method.
if msg.hasArrived {
return
}

created := msg.creationTime()
age := time.Since(created)
t.svc.lostMessages.Inc()
Expand Down

0 comments on commit 5e11446

Please sign in to comment.