docker / go-events

Composable event distribution for Go
Apache License 2.0
131 stars 22 forks source link

Change "dropped events" warning to debug-level log message #11

Closed aaronlehmann closed 8 years ago

aaronlehmann commented 8 years ago

In a project where I use go-events, quite a few unit tests and benchmarks read from a queue until they find what they're looking for, and then stop reading. There may be more events published to the queue afterwards, but there's no non-racy way to consume all of them and still have the test terminate. Thus, these tests and benchmarks tend to log many WARN[0004] eventqueue: dropped event messages.

Change this to the debug log level, so applications and unit tests which use go-events are not forced to always consume all events to suppress these messages.

stevvooe commented 8 years ago

There may be more events published to the queue afterwards, but there's no non-racy way to consume all of them and still have the test terminate

I'd like to address this issue. The goal of go-events is to be able to reliably produce and consume events without losing them. A dropped event can be really problematic in practice.

I suspect the current consumer shutdown procedure is at fault here. This close should be propagated at queue ingress, rather than just drop in flight messages on close.

aaronlehmann commented 8 years ago

Added a big TODO.

stevvooe commented 8 years ago

LGTM