graylog2-server
graylog2-server copied to clipboard
Enforce closing of MongoDB streams
Adds @MustBeClosed annotation to MongoUtils#stream and fixes the resulting errorprone compile issues, mostly by wrapping stream usages in try-with-resources or adding further @MustBeClosed annotation to methods which expose the stream again.
Also bumps the severity of the StreamResourceLeak errorprone check. However, the check doesn't trigger any warnings/errors with the current code base, so no code adjustments are required for this.
/nocl /prd https://github.com/Graylog2/graylog-plugin-enterprise/pull/10999