graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Enforce closing of MongoDB streams

Open thll opened this issue 8 months ago • 0 comments

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

thll avatar Jun 05 '25 13:06 thll