phet commented on code in PR #4031:
URL: https://github.com/apache/gobblin/pull/4031#discussion_r1737160050


##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/DagManagerMetrics.java:
##########
@@ -271,8 +267,7 @@ protected static MetricNameRegexFilter 
getMetricsFilterForDagManager() {
   }
 
   public void cleanup() {
-    // Add null check so that unit test will not affect each other when we 
de-active non-instrumented DagManager
-    if(this.metricContext != null && 
this.metricContext.getTagMap().get(GobblinMetricsKeys.CLASS_META).equals(DagManager.class.getSimpleName()))
 {
+    if (this.metricContext != null && 
this.metricContext.getTagMap().get(GobblinMetricsKeys.CLASS_META).equals(DagManagerMetrics.class.getSimpleName()))
 {
       // The DMThread's metrics mappings follow the lifecycle of the DMThread 
itself and so are lost by DM deactivation-reactivation but the 
RootMetricContext is a (persistent) singleton.
       // To avoid IllegalArgumentException by the RMC preventing (re-)add of a 
metric already known, remove all metrics that a new DMThread thread would 
attempt to add (in DagManagerThread::initialize) whenever running 
post-re-enablement
       RootMetricContext.get().removeMatching(getMetricsFilterForDagManager());

Review Comment:
   this code may need reworking (since aspects recorded in the nearby comments 
seem to be changing), but at the least, update the remaining comment and also 
consider whether to rename `getMetricsFilterForDagManager()`



-- 
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: dev-unsubscr...@gobblin.apache.org

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

Reply via email to