Graylog2 / Graylog2/graylog2-server
Detect EventBus subscriber leaks at compile time
- Dominant language
- Java
- Stars
- 8.1k
- Forks
- 1.1k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 217
Description
PR #25969 fixed an OOM caused by a subscriber leak: `StreamServiceImpl` called `eventBus.register(this)` in its constructor but was not a `@Singleton`. The failure was invisible until OOM: no functional symptom, no test coverage, growth proportional to traffic so it only surfaced on long-running production nodes.
Goal
Alert on this class of bugs at compile time.
Proposal
Add a [PMD rule](https://github.com/Graylog2/graylog2-server/blob/master/config/pmd-rules.xml) to identify missing `@Singleton` annotation
The rule fires even if a singleton is registered via Guice-binding: We always require the class annotation for the sake of clarity.
Contributor guide
Assessment
This issue has not been assessed yet.