-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: eventbus: log error on slow consumers (#3031)
* feat: eventbus: log error on slow consumers Slow consumers can stall libp2p in hard to debug ways. For example, a slow consumer of Identify events can prevent NewStreams from opening. In some cases we do want this back-pressure, but in other cases it is a bug in the user's application (or even in go-libp2p). The recommended approach has been to use metrics with Grafana and Prometheus to identify these issues. In practice, that's been a non-trivial task for users to setup. A simple log would help identify these issues. Note that the codepath is relatively unchanged in the normal case. Only if a producer is stalled will the extra work be put in. Co-authored-by: Wondertan <hlibwondertan@gmail.com> * fix: eventbus: fix deadlock in closing a stalled wildcard subscriber * Hold lock when setting slowConsumer timer --------- Co-authored-by: Wondertan <hlibwondertan@gmail.com>
- Loading branch information
Showing
2 changed files
with
140 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters