asafm commented on code in PR #17852:
URL: https://github.com/apache/pulsar/pull/17852#discussion_r982324246


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsGenerator.java:
##########
@@ -129,6 +135,8 @@ public static void generate(PulsarService pulsar, boolean 
includeTopicMetrics, b
             }
             out.write(buf.array(), buf.arrayOffset(), buf.readableBytes());
         } finally {
+            //release all the metrics buffers
+            metricStreams.releaseAll();

Review Comment:
   Sorry for missing out on this bug. I wasn't aware that 
`PrometheusMetricsGenerator` doesn't look the same in master and in apache-2.9, 
specifically the generate0, and the performance improvement was backported, so 
it confused me as well.
   
   The fix looks solid, as this buffer is not returned as it did in `generate0` 
so it should always be released.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to