adutra commented on PR #1916:
URL: 
https://github.com/apache/cassandra-java-driver/pull/1916#issuecomment-2040209708

   Thanks @SiyaoIsHiding for taking the time to apply my suggestions!
   
   The code changes LGTM.
   
   > 1. I tried hard, but I could not find an example of how to use 
MicroProfile with our driver, especially how to instantiate a MicroProfile 
registry. May I confirm, is it the user's responsibility to implement and pass 
in a MicroProfile `MetricRegistry`?
   
   My recollection here is that MicroProfile does not have the notion of a 
global registry, so yes, it's the user's responsibility to pass a registry to 
the driver context.
   
   > In this case, is it the user's responsibility to ensure there is no memory 
leak?
   
   In my opinion, it's still up to the driver to clear the metrics. Suppose the 
user created a registry that's being shared among many components, one of which 
being a driver `CqlSession`. If the user closes the session, they still may 
want to keep the registry alive, since it's shared. In that case, it would be 
bad if the driver metrics were still present in the registry after the session 
was closed.
   
   > 2. Do we only clear the metrics when a session is closed? Or do we also 
clear the node metrics when a node goes down?
   
   Imho yes, we should clear the metrics. Node metrics contain the node 
endpoint either as part of the metric name, or as a metric tag. If the node 
goes down, those metrics won't be updated anymore, and could start accumulating 
slowly in memory, as nodes go down and come back up under possibly different 
addresses.
   
   If you don't feel comfortable going down that route in this PR, I'm fine 
tackling this as a follow-up task.
   


-- 
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: commits-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to