Skip to content

Send client report when flushing queue#1757

Merged
mattjohnsonpint merged 5 commits intomainfrom
clientreport-on-flush
Jun 28, 2022
Merged

Send client report when flushing queue#1757
mattjohnsonpint merged 5 commits intomainfrom
clientreport-on-flush

Conversation

@mattjohnsonpint
Copy link
Contributor

During shutdown (and when manually requested), we flush the worker queue of all events. However, if there are no events to send, we'll potentially lose accumulated client report information.

This updates the BackgroundWorker.FlushAsync method to send a final client report after flushing, if there is one to send. That also ensures that if events are rate-limited as they are flushed, that the count of discarded events from rate limiting will be sent.

Note that we still respect the shutdown timeout, so if the queue is very backed up there's a chance the client report won't get sent. If instead we wanted to ensure that it always get sent, then we would need to be ok with going past the timeout period.

Additionally, this PR includes some general implementation improvements with FlushAsync, and an unrelated typo fixed.

@mattjohnsonpint mattjohnsonpint merged commit c3b8c85 into main Jun 28, 2022
@mattjohnsonpint mattjohnsonpint deleted the clientreport-on-flush branch June 28, 2022 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants