Open NeilLuno opened 2 weeks ago
Hi @NeilLuno
We've discussed this, and as a result we have added a task to our backlog to see whether we can start this goroutine later. I don't currently have an ETA on when this will be properly looked into, but we will make sure to post any updates on this thread.
For additional context, the behaviour for the asynchronous sending of events to BugSnag changed in the v2.5.0 release of bugsnag-go
. Instead of previously where a goroutine would be triggered for every event report, a single goroutine is now started by BugSnag, and this acts as a queue for events to be sent from.
Hi @mclack. I really appreciate the response. Agree that one goroutine is better than many. We've managed to find a workaround in the meantime.
Describe the bug
At https://github.com/bugsnag/bugsnag-go/blob/master/v2/notifier.go#L7,
newPublisher
kicks off a goroutine at import time. This means that just importing github.com/bugsnag/bugsnag-go/v2 results in a goroutine. As far as I can tell, there's no way to terminate the goroutine.While this isn't a problem for us from a performance point of view, it does mean that when using go.uber.org/goleak, we have to add an exception for
bugsnag-go
. It's not the end of the world, but it's a nuisance.Steps to reproduce
See example program below.
Environment
Example Repo
Example code snippet
Error messages:
``` ```